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....
php call servlet
I have done a php backup application .So there is a form that user pick some files to zip and download.Because of a problem with greek characters I make a servet (java) to create the zip.But I want
What makes a script your own?
If someone finds a login script online, and changes some variable names around and some other minor adjustments. Is that considered there own script? What would define a script as being yours? I
Need help to modify php ELSE code
I'm trying to find a way to have the php code display a message if there is no inventory listed in the box, I just want it to say something like "User has no inventory listed" You can see
ctype() validation - allowing illegal characters
Hello,I use ctype() to filter and validate a user form. However, I am trying to allow certain characters.Example:Code: //Validate Copay $allow = array('$', '.'); if (!empty($copay)
Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email confirmation process.Here is my code :Line number On/Off | Expand/Contract <?php//sessions
Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but when i Created PO with ME21N the info record is OK
cURL proxy
Okay here is the thing... i know how to add proxysCode: curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);curl_setopt($ch, CURLOPT_PROXY,"[i][b]PROXYHERE[/b][/i]");Here are my questions..
an interesting question
Greetings folks, got to ask an interesting question...let sayi have created a function something likefunction xxx($a=4, $b, $c=4) {}now, is there any way to call this function so that i only send the
Confusing Functions
So, I've been reading up on Functions and I like them! However, I need some help using variables in functions, since it's kind of confusing. I just made these functions: <?php function
Request.UrlReferrer
I need to make it so that a page can only be loaded when a button is clicked on a specific page. I don;t want people to be able to browse directly to this page. Whati s the best wasy to achieve this?