Hey, I'm trying to determine if a table already exists in mysql, but doing a query first with mysql_query, then checking $sql as if it a were  TRUE of FALSE. Which I though it would be.  My Code always skips to the }else{ statment after the If().  What is wrong, How I do this? 
I could of sworn I've wrote other scripts using this and it works.
PHP:
			//Check first if it exists 
			$sql = mysql_query("SELECT var FROM fake WHERE token='{$token}'");
			
			if( ! $sql){
			    // Does not exist! Create it.
			    $sql = mysql_query("INSERT INTO fake (var,token) VALUES('$var','$token')") ;
			
			} else {
			//It exists, Update it.
			
                           $sql = mysql_query("UPDATE fake SET var='{$var}' WHERE token='{$token}'") ;
			
			
			}
Also 
echo $sql;  prints out, Resource id #11 or something.. Doesn't seem to say false or true....
Get word number x from string?
How can I use a function to loop through a string, and "have a look at" every word in the string, probably separated by a comma, and print them out, like this:word 1: xxxxword 2: xxxxword 3:
Revoking alter any table from a schema
Hi All,
SWF image using php?
Hello once again.My latest en devour requires me to produce an image of a static .swf that is embedded on a page.Unfortunately, it has a selection of variables passed to it.EgCode: <object
Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:"a.b.c.d.e.f""a.b.c.d.e"I always want it to split at the second "." from the end, so
IP Logger for Voting Script
Can anybody help me place an IP logger into my voting script?I know that maybe it is not as secure, but I would prefer them to be logged into a text file for simplicity's sake.THANKS!The php script is
php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecure, some simple, some lack of attachment capability, some use redirect, etc. How does one find the
PHP search multiple input field box help
I am having a problem with my search script. At current it will simply search by a selected date which is a java based calendar that displays when using id='datedisplay' in the input form field below.
first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete/update button, etc. the problem is I can't make it show the first value inserted in the db, it only
mysql_affected_rows() usage
Possibly a MySQL issue, but the function that is not behaving in the anticipated way is a PHP function.Seems as though mysql_affected_rows() is not returning the desired number so I can move into my
DOMDocument parsing
Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:Code: