<?php $i = mysql_real_escape_string($_GET["i"]); $host = "localhost"; $user = "mdipi_switch"; $pass = "switch"; $datab = "mdipi_switch"; $linkID = mysql_connect($host, $user, $pass) or die("Couldn't connect"); mysql_select_db($datab, $linkID); // The Problem is on this line $query = "SELECT * FROM tutorials WHERE entry_id = '$i'"; $resultID = mysql_query($query, $linkID) or die ("Data not found"); print $resultID; ?>
Okay, this is a toughie, and I’m more than stumped. Basicly, I’m just looking to draw one entry of my DB to print onto the page. The entry from the DB is given in the URL (http://www.mysite/tutorial.php?i=1, for example).
Now, the code above works fine, but only when I use a different query. I used a generic one I had laying around before, and it gave me an output of Recorse ID #3 or something of the sort. When I changed the query to what it is now, I started getting my die message of “Data not found.”
Due to process of elimination, I’ve figured it’s gotta be the query, but I cant see anything wrong with it. I put a comment just above the line in question.
Thanks for any help in advance!
P.S.: I’ve tried replacing the $i in the query to a hard number, and that too results in a resultID fail.