chuddyuk Posted June 13, 2006 Share Posted June 13, 2006 this is my code [code]<?php mysql_connect("localhost","********","***********"); //select which database you want to editmysql_select_db("grange"); $result = @mysql_query("select * from gallery");while($r=@mysql_fetch_array($result)){ $id=$r["id"]; $name=$r["name"]; $who=$r["src"]; echo "$id <br> $name <br> $src ";}?>[/code]Nothing is showing up at all, no errors. when i remove the "@"s then i start getting errors like:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/chuddyuk/public_html/grange/gallery/index.php on line 12but i cant understand this. ive done this loads of times and its worked. anyone know y nothing shows up now?any help is much appriciated!!! Quote Link to comment https://forums.phpfreaks.com/topic/11903-displaying-results-problem/ Share on other sites More sharing options...
ober Posted June 13, 2006 Share Posted June 13, 2006 The @ symbol is error suppression and should be used EXTREMLY sparingly, unlike what you have there. You should be using "or die("some message")" after mysql_query calls. That error is the result of a bad SQL query. Maybe you don't have a table called gallery or maybe you're not connected to the database.You might want to read the "annoying errors" section of the FAQ found in the BIG RED LINK in my signature. Quote Link to comment https://forums.phpfreaks.com/topic/11903-displaying-results-problem/#findComment-45159 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.