Hi there, I am working on my first database site, so far so goo but i am having some problems getting it to display properly... e.g. http://www.mysite.com/index.php?team=0033 will show the team information but http://www.mysite.com/index2345.php?team=fulham wont I have the row set to: team varchar(255) utf8_general_ci Yes NULL should it be something else so letters as well as numbers can be used?
Thanks guys, The query looks like: mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // $id = $_SERVER['PHP_SELF']; $query = "SELECT * FROM football WHERE team = ".$_GET['team']; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); I am pretty su re this is something simple
I would do it more like this: if ($go_team){ $team=$_POST['team']; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // $id = $_SERVER['PHP_SELF']; $query = "SELECT * FROM football WHERE team like '$team'"; $result=mysql_query($query); while ($row = mysql_fetch_array($result){ echo "Team Selected: $team"; } $num=mysql_numrows($result); echo "Total teams displayed: $num"; mysql_close() } <form method="post"> Type team:<br> <input type="text" name="team" value="<?= $team ?>"> <input type="submit" name="go_team"> </form> PHP: Now you are looking for an match (case insensitive) on the team your typing...
Thanks for the offers of help guys and to littlejon for giving me some code to play with. Managed to fix this by simply changing the sql statement to: $query = "SELECT * FROM football WHERE team = '".$_GET['team']."'";
I am not much familliar with mysql database. I have 10 MB mysql size hosting. What happens when it gets full?