displaying info in rows
Moderator: General Moderators
displaying info in rows
Ok
I am writing a script that basically takes data from a table, specifically names of different users, and displays them as links. I have it setup, but when it displays the links, they are right after eachother. http://www.marker5a.com/dbmenu.php I would like to set it up, so that after each link it goes to the next line and puts the next link. My script is
<?php
$db = mysql_connect("*", "*", "*");
mysql_select_db("profile",$db);
$sql="SELECT FirstName,LastName,contact_id FROM `names`";
$result=mysql_query($sql,$db);
while($row=mysql_fetch_array($result))
{
$id = $row["contact_id"];
$FirstName = $row["FirstName"];
$LastName = $row["LastName"];
echo "<a href=http://www.marker5a.com/db.php?id=$id>$FirstName $LastName</a>";
}
?>
PLease help me
Thanks you
Chris
I am writing a script that basically takes data from a table, specifically names of different users, and displays them as links. I have it setup, but when it displays the links, they are right after eachother. http://www.marker5a.com/dbmenu.php I would like to set it up, so that after each link it goes to the next line and puts the next link. My script is
<?php
$db = mysql_connect("*", "*", "*");
mysql_select_db("profile",$db);
$sql="SELECT FirstName,LastName,contact_id FROM `names`";
$result=mysql_query($sql,$db);
while($row=mysql_fetch_array($result))
{
$id = $row["contact_id"];
$FirstName = $row["FirstName"];
$LastName = $row["LastName"];
echo "<a href=http://www.marker5a.com/db.php?id=$id>$FirstName $LastName</a>";
}
?>
PLease help me
Thanks you
Chris
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
Code: Select all
<?php
$db = mysql_connect("*", "*", "*");
mysql_select_db("profile",$db);
$sql="SELECT FirstName,LastName,contact_id FROM `names`";
$result=mysql_query($sql,$db);
while($row=mysql_fetch_array($result))
{
$id = $row["contact_id"];
$FirstName = $row["FirstName"];
$LastName = $row["LastName"];
echo "<a href=http://www.marker5a.com/db.php?id=$id>$FirstName $LastName</a><br />";
}
?>-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
ok
Ive got one more problem. I am trying to display images based on the $id number.
echo "<img src=www.marker5a.com/database/images/$id.jpg>:;
For some reason, it isnt displaying the image though. What should i do. Thanks in advance
Chris
Ive got one more problem. I am trying to display images based on the $id number.
echo "<img src=www.marker5a.com/database/images/$id.jpg>:;
For some reason, it isnt displaying the image though. What should i do. Thanks in advance
Chris
Code: Select all
<?php
$tim= "tim";
echo '<img src=http://theoryofevil.com/faces/' .$tim . '.jpg>';
?>my first example was missed the >