hello, I´m almost a total newbie to PHP or MySQL. I hope you can help me out with my prob.
Here´s what I try to do:
I´ve created a table called test in my mysql db via phpmyadmin and within this table 4 fields:
id (auto_increment), url, name and text. id is set to integer, url and name to varchars and text to text.
Now I´ve coded a small php file which should read out any fielddata into specific tabledata from my html code, here´s an example of what I did:
<head>
</head>
<body>
<table>
<tr>
<td><!-- this is where the id should be displayed --></td>
<td><!-- this is where the url should be displayed --></td>
<td><!-- this is where the name should be displayed --></td>
<td><!-- this is where the text should be displayed --></td>
</tr>
</table>
</body>
I have this script:
<?
$task1 = "SELECT url, urlname FROM test";
$result = mysql_query($task1);
while($row = mysql_fetch_object($result))
{
echo $row->url;
}
?>
I know how to extract the amount of data from a table but how to put them into the <td>´s ? If I have more than one line how do I handle this?
thx for your help, I hope I didn´t forget anything ...
so far
erik