steveangelis Posted August 5, 2008 Share Posted August 5, 2008 I know the answer is something simple but I cannot figure it out: <?PHP $ip = $_POST['ip']; echo $ip; include('config.php'); $linkid = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd"); mysql_select_db("$dbname", $linkid); $result = mysql_query('SELECT ip, username FROM phpbb_ip where ip="$ip"'); while($row = mysql_fetch_array($result)) { echo $row['ip']." - - - - - - - - ".$row['username']; } ?> <form action="ipsearch.php" method="post"><input name="ip" type="text" /> <input name="Submit" type="submit" /></form> I have done and mysql_error and I figured out that it is coming up with a blank and empty query, but I KNOW the database it is coming from is correct. Any ideas? Link to comment https://forums.phpfreaks.com/topic/118184-solved-simple-query/ Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 You're using ' ' around the string in mysql_query so the $ip variable is not being parsed. Link to comment https://forums.phpfreaks.com/topic/118184-solved-simple-query/#findComment-608171 Share on other sites More sharing options...
revraz Posted August 5, 2008 Share Posted August 5, 2008 $result = mysql_query("SELECT ip, username FROM phpbb_ip where ip='$ip'"); Link to comment https://forums.phpfreaks.com/topic/118184-solved-simple-query/#findComment-608175 Share on other sites More sharing options...
steveangelis Posted August 5, 2008 Author Share Posted August 5, 2008 Thank you I knew it was something simple. Link to comment https://forums.phpfreaks.com/topic/118184-solved-simple-query/#findComment-608177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.