I've got a php script which queries mysql for a certain row based on it's id.
This works fine for the first 3 rows , but on the 4th it returns nulls on all fields.
Here's the query:
mysql_query("SELECT ind,title,body,img,tags,live FROM project WHERE ind = '".$curid."' ")
let me know if you need to see more code.
I'm going to take a guess that the forth row doesn't have the id you think it does. Return them all (remove the where statement) and output them to the screen to check, or use a database browsing tool, if you have one.
Try some debugging..
$q = "SELECT ind,title,body,img,tags,live FROM project WHERE ind = '".$curid."' ";
$rs = mysql_query($q) or die("MySQL error in Query: ". $q ."<br><br>The error is:<br>".mysql_error());
when you execute query, change $curid by value that you consider is correct. verify result, if yet get null values, you can do it:
mysql_query("SELECT ind,title,body,img,tags,live FROM project WHERE ind = '".$curid."' " and
ind IS NOT NULL and title IS NOT NULL
)
for example
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.