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....
Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.Some code runs as perfectly valid code, where i would like PHP to issue a warning / error.I guess this is because of the loose typing of PHP,
Search function
I am looking for some guidance from the experts.I am trying to create a search function. It will only be searching one table. The search criteria consists of two drop down menus. Each menu lists
Help With editting and deleting form
Hallo !!So look at this image :http://img194.imageshack.us/img194/8272/snapshot5f.png This table prints the titles of entries from a table in a database.. The code that i use for this table is this
Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). I am currently making a login form and the associated php code. It all seems to work apart from the
Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter and facebook with the @ sign to start it off, however even though im good at php coding and have
listcube issue
Hi
SAP FICO learning materials
Hi all,
split string
Hi all i have some names (imploded by comma):Code: toronto,paris,madridNow, i would obtain this result:Code: 'toronto','paris','madrid'How can i do? thanks
PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.Thanks!
Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data displayed on the bar graph .The problem is that Y-axis of the chart resizes in function to the