[PHP] Help needed about queries with MySQL, thanks.
Hello everyone, I am a new PHP user, from Belgium. I am trying to manage a MySQL database with PHP, and I kindly request your help to solve a little (probably very stupid) problem I have been dealing with for a while already ... I have a MySQL database (called "sessions") with a auto-increment INT field called "sessionID". I try to check if there is already a record in this database with a given sessionID, which is called $sessionID in PHP. I use this query, which must be wrong (but I cannot find out why !!!) : SELECT * FROM sessions WHERE sessionID = $sessionID Even though there is already a record with the right sessionID, my program does not find it (I always get 0 when using mysql_num_rows() after the query). Though, if I replace "$sessionID" by, for example 4, then that works and it says there is already a record with that ID. I guess the problem comes from comparing two different kinds of variables, but I can't fix it ... Could anyone please help ? By advance, thank you !!! Best regards from Belgium, Jean-marc
Re: [PHP] Help needed about queries with MySQL, thanks.
Thanks for your suggestion ... Yes, I tried to print $sessionID (using echo()) and I get the right value (the one I am looking for) ... Though the query does not work. Any other idea ??? Thanks again ! Jean-Marc - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 18, 2002 11:53 AM Subject: Re: [PHP] Help needed about queries with MySQL, thanks. > On Sunday 18 August 2002 17:45, Jean-Marc Godart wrote: > > > I have a MySQL database (called "sessions") with a auto-increment INT field > > called "sessionID". I try to check if there is already a record in this > > database with a given sessionID, which is called $sessionID in PHP. I use > > this query, which must be wrong (but I cannot find out why !!!) : > > > >SELECT * FROM sessions WHERE sessionID = $sessionID > > > > Even though there is already a record with the right sessionID, my program > > does not find it (I always get 0 when using mysql_num_rows() after the > > query). Though, if I replace "$sessionID" by, for example 4, then that > > works and it says there is already a record with that ID. > > > > I guess the problem comes from comparing two different kinds of variables, > > but I can't fix it ... Could anyone please help ? By advance, thank you !!! > > Have you tried printing out $sessionID to see whether it contains what you > think it contains? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Under capitalism, man exploits man. Under communism, it's just the opposite. > -- J.K. Galbraith > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simultaneous system(),passthru()... commands. HELP PLEASE !!!
Hello everyone, I am using PHP with Windows XP. I am trying to have a ".exe" program (written and compiled in C) launched by my PHP script, using either system(), passthru()... That works great ... as long as I only have one request at a time. When I have two (or more request) at the same time (coming from different browser sessions), the execution of the .exe program seems to be aborted for all sessions as soon as it is finished for one of the sessions. Therefore only the first finishing session gets the good result, the other sessions keeping waiting for an output that will never come. The same problem arises if those are different .exe programs that are launched at the same time, for example program1.exe, program2.exe and program3.exe ; if program1.exe ends first, program2.exe and program3.exe get aborted ... How come ? How can I avoid that ? By advance, thank you for your help and comments ... Best regards from Belgium, Jean-Marc
[PHP] "The application could not initialize correctly" ...
Hello ! I installed for the third time EasyPHP on my computer (with Windows XP), and I keep having the same little problem : when I turn off my computer with EasyPHP (Apache) on, I get an error message saying "cmd.exe : the application could not initialize correctly ...". This is no big deal as the computer turns off anyway, but that kind of bugs me. Can anyone tell me why it is doing this and how I can possibly change that ? By advance, thank you ! Best regards, Jean-Marc, Belgium -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to display a "waiting page" while a CGI is running ?
Hello, I need to have a "waiting page" displayed, with an animated GIF, while a CGI is running. As soon as the CGI has finished running, the waiting page should be replaced by a page displaying the results of the CGI. I had no problem to do this in Windows, but it is not working in Linux. Any idea about how to do this in Linux ? Thank you. Regards, Jean-Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php