Hi.
Well i've been trying to make a little script for a mates website.
What it does, you type something into a text field, it searches the database for the value in that textfield, if there is an entry already like that in the database, it will not add it, if there isn't, it will add into the database.
Kinda like a Registration form (But its not, same principle)
Here is my code (Some bits edited out)
<?php
$dbhost = "mysql"; //Database Host
$dbuser = "###"; //Database User
$dbpass = "###"; //Database Password
$dbname = "###"; //Database Name
//connect
$db = mysql_pconnect($dbhost,$dbuser,$dbpass);
mysql_select_db("$dbname",$db);
$searchdb="SELECT * FROM ### WHERE keywords ='$_POST[###]';
$result=mysql_query($searchdb);
$num=mysql_num_rows($result);
if ($num = 0){
echo "No results found";
}else{
echo "Found results";
}
?>
Now im sure i haven't missed any ; because i have looked over it, and i have viewed tutorials online that use this code almost EXACT (Just changed entires etc).
But here is the error:
Parse error: syntax error, unexpected T_STRING in /hosted/subs/ulmb.com/t/h/###/public_html/### on line 19
Eh, im probably being an idiot again lols. I need to learn errors asap.
But thanks.