Here the PHP:
<?php
$db = mysql_connect(“name”,“user”,“pass”);
mysql_select_db(“links” ,$db);
$sql = mysql_query(“SELECT * FROM links” ,$db);
echo ("<table border =‘1’>");
echo ("<tr><td>url</td><td>description</td></tr>");
echo("<tr><td><a href=’$tablerows[1]’>$tablerows[1]</a></td><td>$tablerows[2]</td></tr> ");
echo “</table>”;
mysql_close($db);
?>
and i have a “links” table with 3 fields named id, url, and description…
and when i upload it to the server all i get is a two column table with “url” and “description” … the links that i created in the url field, their descriptions do not seem to appear???
The other problem you have is you must define which row you want to grab off the DB by using a WHERE statement in your SQL query, like this:
$tablerows = mysql_fetch_row(mysql_query(“SELECT * FROM links WHERE id=‘number’” ,$db));
yep!
Check out http://php.net for descriptions of the many functions of PHP.
Check out http://www.w3schools.com/ for some tutorials on PHP and SQL statements.
take a look at this tutorial for database interaction.
and lastely learn about relational databases, which is what kinda database mySQL is.
have fun :mu:
ohhh, ok, well thats the problem. I assumed you changed that to a number.
The ‘number’ needs to be the row number that you want to grab, or the primary ID row.