Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Other » PHP issue
PHP issue [message #438943] Fri, 05 November 2010 16:24 Go to previous message
cnc95fan is currently offline  cnc95fan
Messages: 1261
Registered: July 2007
Karma:
General (1 Star)
I started learning PHP about 2 weeks ago and have gotten as far as small database things..
I decided as a first project I would make some sort of system for my school library, however I can't see what is wrong with this code. The page shows up blank (I had a "or die()" after the mysql_connect function) with no info on it.
<?php
$var = $_POST['bookid'];
if(isset($var)) {

$con = mysql_connect("localhost","root","1234");
mysql_select_db("library");
$bookinfo = mysql_query("SELECT * FROM books WHERE bookid = $_POST['bookid']");
while($row = mysql_fetch_array($bookinfo))
{
echo $row['bookid'] . $row['id'];
}
}
echo "Test echo";
?>

The form sending the POST data sends <input type="text" name="bookid"/>
I am able to connect to the mysql db as I have tried with another page (which simply shows text on it from a db).
The "Test echo" does not show.
Anybody able to shed some light on this?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GameSpy
Next Topic: Generals... AGAIN
Goto Forum:
  


Current Time: Mon Nov 25 09:08:58 MST 2024

Total time taken to generate the page: 0.01046 seconds