Arsench Posted September 20, 2006 Share Posted September 20, 2006 HELLO ALL PLEASE WHO CAN HELP ME TO DISPLAY DATA ON THE WEB PAGE.HERE IS CODE BUT IT DOESNT WORK.THANK YOU ALL<?php$username="5543";$password="123456";$database="5543";mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");$sql = mysql_query("SELECT * FROM links" ,$db);$result=mysql_query($sql);echo ("<table border ='1'>"); echo ("<tr><td>Category</td><td>E-mail</td><td>URL</td><td>Description</td></tr>"); while ($tablerows = mysql_fetch_row($sql)) { echo("<tr><td><a href='$tablerows[0]'>$tablerows[1]</a></td><td>$tablerows[2]</td><td>$tablerows[3]</td><td>$tablerows[4]</td></tr> "); } echo "</table>"; mysql_close($db); ?> Quote Link to comment https://forums.phpfreaks.com/topic/21396-select-db/ Share on other sites More sharing options...
tomfmason Posted September 20, 2006 Share Posted September 20, 2006 You need to remove the $db from the end of your query...Like this.[code=php:0]$sql = mysql_query("SELECT * FROM links") or die(mysql_error());[/code]Also, you might want to through in a [code=php:0]or die(mysql_error());[/code] like shown above. This will allow you to see any sql errors that you may have.Hope this helps,Tom Quote Link to comment https://forums.phpfreaks.com/topic/21396-select-db/#findComment-95250 Share on other sites More sharing options...
Arsench Posted September 20, 2006 Author Share Posted September 20, 2006 [quote author=tomfmason link=topic=108770.msg437871#msg437871 date=1158755460]You need to remove the $db from the end of your query...Like this.[code=php:0]$sql = mysql_query("SELECT * FROM links") or die(mysql_error());[/code]Also, you might want to through in a [code=php:0]or die(mysql_error());[/code] like shown above. This will allow you to see any sql errors that you may have.Hope this helps,Tom[/quote]thank you friend but can see the results .you can see here the saithttp://khaarsen.ueuo.com/list.php its gives a blank page always Quote Link to comment https://forums.phpfreaks.com/topic/21396-select-db/#findComment-95256 Share on other sites More sharing options...
ober Posted September 20, 2006 Share Posted September 20, 2006 It doesn't look blank to me. Quote Link to comment https://forums.phpfreaks.com/topic/21396-select-db/#findComment-95301 Share on other sites More sharing options...
redarrow Posted September 20, 2006 Share Posted September 20, 2006 Can you post that whole page that is displaying in the link please cheers. Quote Link to comment https://forums.phpfreaks.com/topic/21396-select-db/#findComment-95303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.