[PHP-DB] cookie problems
can anyone help me with this code? i cant believe it wont work, it seems pretty simple! ?php setcookie (logged_in, logged in, time() - 3600); setcookie (logged_user_name, logged user name, time() - 3600); print $logged_in br; print $logged_user_name; ? brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] cookie problems
HI, my guess is is that the cookies will be killed the NEXT time you run this script. Ken - Original Message - From: Brad Lipovsky [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 10, 2001 11:24 PM Subject: [PHP-DB] cookie problems can anyone help me with this code? i cant believe it wont work, it seems pretty simple! ?php setcookie (logged_in, logged in, time() - 3600); setcookie (logged_user_name, logged user name, time() - 3600); print $logged_in br; print $logged_user_name; ? brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP4 + interbase = bug?
Hi, What version of php4 you're running and on what OS. I had this problem too but when I switched to php 4.06 on win2000 the interbase dll worked just fine. Dobromir Velev -Original Message- From: Wagner R. Landgraf [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, July 10, 2001 11:53 PM Subject: [PHP-DB] PHP4 + interbase = bug? Hello, I've used PHP4 + Interbase and I got a PHP Program executed an ilegal operation bla bla bla bla. in a very very simple php script. Then I switched back to PHP3 and everything is fine (well, everything for this only little script I've tested). Is this know? Is PHP4 + Interbase buggy? What about PHP3? Is it ok with Interbase? Thank you all Wagner R. Landgraf Automa Consultoria Informática Ltda. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] losing data from a mysql database field
Hi, did you try to use quotes around the field value input type=text name=your_text value=value or echo input type='text' name='field_name' value='$field_value'; Dobromir Velev -Original Message- From: Geoffrey Makstutis [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, July 10, 2001 9:03 PM Subject: [PHP-DB] losing data from a mysql database field Hi, I'm having an odd occurrence using mysql. If I insert into a varchar field with information like This is the information, it works fine and I can retreive and display the data using a normal 'print' or 'echo' statement. However, if I try to display the data in a form field (so that I can edit the data) I only get This (ie. I am losing everything after the first whitespace character). Is there anything that anyone could suggest that would solve this problem? Thanks. Geoffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] cookie problems
The variables wont become available until the cookies are read - which happens when the script is first loaded. Normally the cookies are set, then a header is sent to reload the page - but be carful not to create an endless loop of browser reloading... Check out the examples on: http://www.php.net/manual/en/function.setcookie.php if you still can't get it working, let us know... Tom At 23:40 10/07/2001 -0700, you wrote: HI, my guess is is that the cookies will be killed the NEXT time you run this script. Ken - Original Message - From: Brad Lipovsky [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 10, 2001 11:24 PM Subject: [PHP-DB] cookie problems can anyone help me with this code? i cant believe it wont work, it seems pretty simple! ?php setcookie (logged_in, logged in, time() - 3600); setcookie (logged_user_name, logged user name, time() - 3600); print $logged_in br; print $logged_user_name; ? brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Update records on MySql with a form.......
Hello all, I have a form with my fileds filled with ECHO strings from a query, in order to get the values of a product stored in MySql. The question is: wich is the string in order to update the fields I change in the form Thank´s all -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Php and Mysql: Aborted connection to mySQL with PHP4
I'm using Php 4.0.1 pl2-9 and Mysql 3.23.22 and gets the following error in Mysqls logfile: 010711 10:58:52 Aborted connection 381 to db: 'improvement' user: 'webusr' host: `web.local' (Got an error reading communication packets) After a while mysql doesn't accept more connection because it has reached the maximum connection error and i must do a host-flush. The problem only appears when I run php on the same server, when I run php from my windows machine (later version of php) against the same database i dont get the error. Is is a bug so i shall upgrade php or is it a miss configuration done by me? /Andreas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Row order
Hello! I have this little problem sorting a search result by different fieldnames. I do my search, get a quite impressive amount of variables that I use in my MySQL-query, and by default use ORDER BY name. But I want to be able to klick on different headers to sort like ORDER BY $order. The problem that I encounter is that I lose all the variables from the search when I refresh the document. Is it possible to resend all variables without inserting them in the A-tag ? (like A href=find.php?var1=$var1..) Hopefully someone has a smart solution.. =) regards - Stefan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Row order
Cookie or session? A little extreme, but if you don't want it in the url then that's the only other way I can think of to remember a variable when the page is refreshed.. Tom At 13:09 11/07/2001 +0200, you wrote: Hello! I have this little problem sorting a search result by different fieldnames. I do my search, get a quite impressive amount of variables that I use in my MySQL-query, and by default use ORDER BY name. But I want to be able to klick on different headers to sort like ORDER BY $order. The problem that I encounter is that I lose all the variables from the search when I refresh the document. Is it possible to resend all variables without inserting them in the A-tag ? (like A href=find.php?var1=$var1..) Hopefully someone has a smart solution.. =) regards - Stefan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] PHP4 + interbase = bug?
Hi. I was using Apache 1.3.12 + Win 95 + PHP 4.06. - Original Message - From: Dobromir Velev [EMAIL PROTECTED] To: Wagner R. Landgraf [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 4:15 AM Subject: Re: [PHP-DB] PHP4 + interbase = bug? Hi, What version of php4 you're running and on what OS. I had this problem too but when I switched to php 4.06 on win2000 the interbase dll worked just fine. Dobromir Velev -Original Message- From: Wagner R. Landgraf [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, July 10, 2001 11:53 PM Subject: [PHP-DB] PHP4 + interbase = bug? Hello, I've used PHP4 + Interbase and I got a PHP Program executed an ilegal operation bla bla bla bla. in a very very simple php script. Then I switched back to PHP3 and everything is fine (well, everything for this only little script I've tested). Is this know? Is PHP4 + Interbase buggy? What about PHP3? Is it ok with Interbase? Thank you all Wagner R. Landgraf Automa Consultoria Informática Ltda. [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Warning: Page has Expired
I've setup a members directory in mysql that is searchable via different field and I limit the number of records. I use session variables to remember the number of records to display, what the starting record is, what the search string and search fields are. At anytime a user can click on an id number to do a Select statement that queries for that single row of data. Afterward, if the user hits their browsers back button I get: Warning: Page has Expired I've noticed allot of sites just ask the user to not use the back button. I'm curious if this is caused by an error in my code or because I used session variables that might have changed in the last MySQL select query. So that when you hit back, the browser is using some sort of cached data while still loading the php code? I'm very confused at this point. Is there anything I can do to prevent the Expired Page warning, rather than expecting my viewers to learn to do without it. Keith Spiller [EMAIL PROTECTED]
RE: [PHP-DB] Re: problem running stored MsSQL procedure
So what is actually the problem with running sp in mssql? Mike -Original Message- From: Carpe Diem Support [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 3:32 PM To: Hugh Bothwell; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Re: problem running stored MsSQL procedure -Original Message- From: Hugh Bothwell [mailto:[EMAIL PROTECTED]] Sent: 11 July 2001 14:21 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Re: problem running stored MsSQL procedure (ahem) MySQL does not support stored procedures. If you really need them, look at PostgreSQL. The question was actually mssql not mysql :)) D'oh! Going blind in my old age, I guess... heheheh :) Easy mistake to make :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Warning: Page has Expired
I had this problem, too. It seems as though when using session variables and POST forms, you get this error when trying to go back to a POSTed page. I believe I read somewhere that the error is more of a security issue - to keep others from simply going back and seeing any private data, but I'm not clear on how that works. I finally found a plausible fix, though. Just open up your php.ini file and look for [Session]. Under it should be session.cache.limiter - just set that to a blank. Here's my [Session] section: BEGIN SNIPPET [Session] session.save_handler = files ; handler used to store/retrieve data session.save_path = /tmp; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 1 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start= 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for session.serialize_handler = php ; handler used to serialize data ; php is the standard serializer of PHP session.gc_probability= 1 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime= 1440; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process session.referer_check = ; check HTTP Referer to invalidate ; externally stored URLs containing ids session.entropy_length= 0 ; how many bytes to read from the file session.entropy_file = ; specified here to create the session id ; session.entropy_length= 16 ; session.entropy_file = /dev/urandom session.cache_limiter = ; (leaving it blank) ; session.cache_limiter = nocache ; set to {nocache,private,public} to ; determine HTTP caching aspects session.cache_expire = 180 ; document expires after n minutes session.use_trans_sid = 1 ; use transient sid support if enabled ; by compiling with --enable-trans-sid - END SNIPPET - Hope this helps. - Jonathan Keith Spiller [EMAIL PROTECTED] wrote in message 003401c10a0f$6bd7da60$3083140a@aristotle">news:003401c10a0f$6bd7da60$3083140a@aristotle... I've setup a members directory in mysql that is searchable via different field and I limit the number of records. I use session variables to remember the number of records to display, what the starting record is, what the search string and search fields are. At anytime a user can click on an id number to do a Select statement that queries for that single row of data. Afterward, if the user hits their browsers back button I get: Warning: Page has Expired I've noticed allot of sites just ask the user to not use the back button. I'm curious if this is caused by an error in my code or because I used session variables that might have changed in the last MySQL select query. So that when you hit back, the browser is using some sort of cached data while still loading the php code? I'm very confused at this point. Is there anything I can do to prevent the Expired Page warning, rather than expecting my viewers to learn to do without it. Keith Spiller [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Re: Warning: Page has Expired
You can also change your form to use the GET method instead. That works without changing your php.ini file. But don't use GET methods for logging in or passing secure information. It's much more insecure than POSTing (not that POSTing variables is a 100% secure method, either)... Keith Spiller [EMAIL PROTECTED] wrote in message 003401c10a0f$6bd7da60$3083140a@aristotle">news:003401c10a0f$6bd7da60$3083140a@aristotle... I've setup a members directory in mysql that is searchable via different field and I limit the number of records. I use session variables to remember the number of records to display, what the starting record is, what the search string and search fields are. At anytime a user can click on an id number to do a Select statement that queries for that single row of data. Afterward, if the user hits their browsers back button I get: Warning: Page has Expired I've noticed allot of sites just ask the user to not use the back button. I'm curious if this is caused by an error in my code or because I used session variables that might have changed in the last MySQL select query. So that when you hit back, the browser is using some sort of cached data while still loading the php code? I'm very confused at this point. Is there anything I can do to prevent the Expired Page warning, rather than expecting my viewers to learn to do without it. Keith Spiller [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] RE: Row order
Good Morning, You could create a form and save your variables as hidden elements of your form. I've never tried it without having an actual visible form on the page with a submit button and everything, but it should work. The only other ways I can think of are pretty long winded...cookies, database entries, file entries... Good Luck, Rita. -Original Message- From: Stefan Doverud [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 4:10 AM To: [EMAIL PROTECTED] Subject: Row order Hello! I have this little problem sorting a search result by different fieldnames. I do my search, get a quite impressive amount of variables that I use in my MySQL-query, and by default use ORDER BY name. But I want to be able to klick on different headers to sort like ORDER BY $order. The problem that I encounter is that I lose all the variables from the search when I refresh the document. Is it possible to resend all variables without inserting them in the A-tag ? (like A href=find.php?var1=$var1..) Hopefully someone has a smart solution.. =) regards - Stefan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: Warning: Page has Expired
Thanks Jonathan, The Microsoft site says just that, that it is a security precaution. http://support.microsoft.com/support/kb/articles/q183/7/63.asp But I wonder, is it only caused by PHP or ASP pages? If so, what is to stop me from creating an line in my .htaccess file that forces the Apache server to treat say .shtml files as .php files? Wouldn't this fix the problem? Maybe I'm grabbing at straws... Also the GET does not send the session variables. It seems that a single line in the .asp files can fix this problem, so obviously, IIS is doing something, maybe converting method POST to GET? There must be a way... Keith - Original Message - From: Jonathan Hilgeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 9:33 AM Subject: [PHP-DB] Re: Warning: Page has Expired You can also change your form to use the GET method instead. That works without changing your php.ini file. But don't use GET methods for logging in or passing secure information. It's much more insecure than POSTing (not that POSTing variables is a 100% secure method, either)... Keith Spiller [EMAIL PROTECTED] wrote in message 003401c10a0f$6bd7da60$3083140a@aristotle">news:003401c10a0f$6bd7da60$3083140a@aristotle... I've setup a members directory in mysql that is searchable via different field and I limit the number of records. I use session variables to remember the number of records to display, what the starting record is, what the search string and search fields are. At anytime a user can click on an id number to do a Select statement that queries for that single row of data. Afterward, if the user hits their browsers back button I get: Warning: Page has Expired I've noticed allot of sites just ask the user to not use the back button. I'm curious if this is caused by an error in my code or because I used session variables that might have changed in the last MySQL select query. So that when you hit back, the browser is using some sort of cached data while still loading the php code? I'm very confused at this point. Is there anything I can do to prevent the Expired Page warning, rather than expecting my viewers to learn to do without it. Keith Spiller [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Production: Linux/Apache/PHP -- FreeTDS -- W2K/MSSQL 7.0
Hi I am developing my website with this combo: W2K/IIS/PHP -- W2K/MSSQL7.0 When I switch to production I intend to use: Linux/Apache/PHP -- FreeTDS -- W2K/MSSQL7.0 My question is this: Will I be able to use ALL the PHP MSSQL functions (as listed in the PHP docs) when on the Linux combo? I am particularly concerned about the mssql_next_result function (such a function doesn't exist for Sybase and I don't know enough about how FreeTDS works). Thanks for your time Peter -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] alphanumeric
the ctype_alnum is experimental. is there an easy way wherein i can identify if the input is an alphanumeric? thanks for your help.
[PHP-DB] Oracle Client Libraries?
Hi all. Where can I get the Oracle client libraries for PHP4? I am running Apache and PHP4 on my NT Server and I will be connecting to an Oracle database on a Solaris server via remote connect? I saw some threads earlier indicating that they could be found at download.swwwing.com but that server is apparantly no longer running. Anyone? Thanks. Tom Tsongas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Oracle Client Libraries?
Tom, From Oracle :) Alternativley you can use the OpenLink Multi-Tier ODBC driver at www.openlinksw.com. It downloads with a free 2-connection license, and has free support available at www.openlinksw.com/support/suppindx.htm HTH! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access Data Integration Technology Providers -Original Message- From: Tom Tsongas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 12:56 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Oracle Client Libraries? Hi all. Where can I get the Oracle client libraries for PHP4? I am running Apache and PHP4 on my NT Server and I will be connecting to an Oracle database on a Solaris server via remote connect? I saw some threads earlier indicating that they could be found at download.swwwing.com but that server is apparantly no longer running. Anyone? Thanks. Tom Tsongas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Oracle Client Libraries?
Hi again. I just found an above message that states the DLLs I need are in the PHP package I installed and I just need to uncomment them from php.ini. Am I off the beaten track or is that true? I found the listings for php_oracle.dll and php_oci8.dll in php.ini under the 'Dynamic Extensions' section. I'm 'guessing' I only need to restart Apache now to activate the extensions. In my scenario, php and Apache are on my local NT server while the Oracle database is on a Solaris box. Anything else I need to know? Thanks in advance. Tom Anthony Carlos wrote: Tom: Go to technet.oracle.com and download Oracle 8i Database for WinNT. When you run the installer, you can do a custom set-up to only install the networking libraries (Net8). Run Net8 Easy Config. That will get you started. I'm not sure how much it costs officially. You'll have to call up Oracle for current pricing. Anthony Carlos -Original Message- From: Tom Tsongas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 12:56 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Oracle Client Libraries? Hi all. Where can I get the Oracle client libraries for PHP4? I am running Apache and PHP4 on my NT Server and I will be connecting to an Oracle database on a Solaris server via remote connect? I saw some threads earlier indicating that they could be found at download.swwwing.com but that server is apparantly no longer running. Anyone? Thanks. Tom Tsongas -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Are PHP user-defined functions recursive?
Manual says: --- Any valid PHP code may appear inside a function, even other functions and class definitions. In PHP 3, functions must be defined before they are referenced. No such requirement exists in PHP 4. PHP does not support function overloading, nor is it possible to undefine or redefine previously-declared functions. - I say: What is function overloading? Can a php user-defined function call itself from within itself? thanks, Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] TO_DAYS() equivalent?
check out the mktime() function David W. Banks [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there some way to get the equivalent of select TO_DAYS(NOW()) out of PHP without querying MySQL (or whatever.) Some formatting character for the date() function that I'm just missing? Thanks, -Dave -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] RE: Row order
If you created each column name on the table (i assume that's how this is working) and then as rita said, dump the searched variables as hidden inputs, then you could have something like this happen; form name=reorder action=?php echo $PHP_SELF ? method=POST input type=hidden name=first_var value=myVal input type=hidden name=second_var value=yourVal input type=hidden name=sort value= a href=javascript:document.reorder.sort.value='position'; document.reorder.submit();Sort By Position/a /form which sets the value of the empty $sort input field to position and then submits the form, so you can look for $sort and assuming it's a valid field name, do something like SELECT * FROM people ORDER BY . $sort HTH Beau // -Original Message- // From: Mikusch, Rita [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 11 July 2001 11:28 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] RE: Row order // // // Good Morning, // // You could create a form and save your variables as hidden // elements of your // form. I've never tried it without having an actual visible // form on the page // with a submit button and everything, but it should work. // // The only other ways I can think of are pretty long winded...cookies, // database entries, file entries... // // Good Luck, // // Rita. // // -Original Message- // From: Stefan Doverud [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, July 11, 2001 4:10 AM // To: [EMAIL PROTECTED] // Subject: Row order // // // Hello! // // I have this little problem sorting a search result by // different fieldnames. // // I do my search, get a quite impressive amount of variables // that I use in my // MySQL-query, and by default use ORDER BY name. // // But I want to be able to klick on different headers to sort // like ORDER BY // $order. // // The problem that I encounter is that I lose all the // variables from the // search when I refresh the document. Is it possible to resend // all variables // without inserting them in the A-tag ? // (like A href=find.php?var1=$var1..) // // Hopefully someone has a smart solution.. =) // // regards // // - Stefan // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Left Join is producing duplicate results - MySQL relational tables
Hello, I posted this to the general list this morning got a couple of good leads, but they weren't able to actually fix the problem, so I'm posting here to the db list. I'm making some headway on joining three MySQL tables. However, when I run this query: mysql_query(SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName, WLPprofile.lastName, WLPprofile.organization, WLPcountry.languageName FROM WLPbib LEFT JOIN WLPprofile ON WLPprofile.profileID = WLPbib.profileID LEFT JOIN WLPaddress ON WLPaddress.publisherID = WLPbib.publisherID LEFT JOIN WLPcountry ON WLPcountry.countryID = WLPaddress.countryID); I now get results in triplicate. ie. I'm getting three copies of the same title, firstName, organization, etc I somehow suspected that this should be the result with LEFT JOIN, but I'm not sure how to return a query without duplication. This is far better than what I had this morning (which was no response from the server). Thanks. I'm new to joining tables... Someone wrote back suggesting that SELECT DISTINCT could be used to to the job. Another person suggested that using UNIQUE(profileID) would make it look nicer. I wasn't sure how to use UNIQUE with the last JOIN as it isn't directly linked to WLPbib.. Any suggestions would be useful. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Need a shopping cart
Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Need a shopping cart
Jeff Have you tried: http://www.hotscripts.com it seems to have a huge selection of PHP scripts - i'm not sure if it has what you are after though. Why don't you have MySQL installed on your NT machine? It is a LOT quicker than any MS Access database, or flat file - especially if you are setting up a shopping cart site. Tom At 18:46 11/07/2001 -0700, you wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
Mike - I'm not certain but it sounds like you might be looking for GROUP BY. Do GROUP BY and then the columns that are identical in your results. - Ken At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: Hello, I posted this to the general list this morning got a couple of good leads, but they weren't able to actually fix the problem, so I'm posting here to the db list. I'm making some headway on joining three MySQL tables. However, when I run this query: mysql_query(SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName, WLPprofile.lastName, WLPprofile.organization, WLPcountry.languageName FROM WLPbib LEFT JOIN WLPprofile ON WLPprofile.profileID = WLPbib.profileID LEFT JOIN WLPaddress ON WLPaddress.publisherID = WLPbib.publisherID LEFT JOIN WLPcountry ON WLPcountry.countryID = WLPaddress.countryID); I now get results in triplicate. ie. I'm getting three copies of the same title, firstName, organization, etc I somehow suspected that this should be the result with LEFT JOIN, but I'm not sure how to return a query without duplication. This is far better than what I had this morning (which was no response from the server). Thanks. I'm new to joining tables... Someone wrote back suggesting that SELECT DISTINCT could be used to to the job. Another person suggested that using UNIQUE(profileID) would make it look nicer. I wasn't sure how to use UNIQUE with the last JOIN as it isn't directly linked to WLPbib.. Any suggestions would be useful. Mike -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Need a shopping cart
Probably cause his host is extremely ghetto and refuses to install anything non M$FT =P ...and he doesn't have full admin access to the server. -- David Balatero -Original Message- From: Tom Peck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 6:53 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Need a shopping cart Jeff Have you tried: http://www.hotscripts.com it seems to have a huge selection of PHP scripts - i'm not sure if it has what you are after though. Why don't you have MySQL installed on your NT machine? It is a LOT quicker than any MS Access database, or flat file - especially if you are setting up a shopping cart site. Tom At 18:46 11/07/2001 -0700, you wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
Mike - In general, you should always be reading the manual first. From the SELECT syntax at http://www.mysql.com/doc/S/E/SELECT.html GROUP BY must be indicated before ORDER BY. So reverse the order of those portions. - Ken At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: It looked good, but it gave me an error.. Sorry ... WLPcountry.countryID ORDER BY WLPbib.title GROUP BY WLPbib.bibID MySQL Error: 1064 (You have an error in your SQL syntax near 'GROUP BY WLPbib.bibID ' at line 10) Please contact the webmaster and report the exact error message. Session halted. Ken wrote: Mike - I'm not certain but it sounds like you might be looking for GROUP BY. Do GROUP BY and then the columns that are identical in your results. - Ken At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: Hello, I posted this to the general list this morning got a couple of good leads, but they weren't able to actually fix the problem, so I'm posting here to the db list. I'm making some headway on joining three MySQL tables. However, when I run this query: mysql_query(SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName, WLPprofile.lastName, WLPprofile.organization, WLPcountry.languageName FROM WLPbib LEFT JOIN WLPprofile ON WLPprofile.profileID = WLPbib.profileID LEFT JOIN WLPaddress ON WLPaddress.publisherID = WLPbib.publisherID LEFT JOIN WLPcountry ON WLPcountry.countryID = WLPaddress.countryID); I now get results in triplicate. ie. I'm getting three copies of the same title, firstName, organization, etc I somehow suspected that this should be the result with LEFT JOIN, but I'm not sure how to return a query without duplication. This is far better than what I had this morning (which was no response from the server). Thanks. I'm new to joining tables... Someone wrote back suggesting that SELECT DISTINCT could be used to to the job. Another person suggested that using UNIQUE(profileID) would make it look nicer. I wasn't sure how to use UNIQUE with the last JOIN as it isn't directly linked to WLPbib.. Any suggestions would be useful. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
Sorry Ken, I'm trying to learn a few too many things at once. Switching it around eliminated the error message but not the duplication. I'm eliminating as much of the code as I can to see that it isn't coming from PHP. Thanks again for your help. Mike Ken wrote: In general, you should always be reading the manual first. From the SELECT syntax at http://www.mysql.com/doc/S/E/SELECT.html GROUP BY must be indicated before ORDER BY. So reverse the order of those portions. - Ken At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: It looked good, but it gave me an error.. Sorry ... WLPcountry.countryID ORDER BY WLPbib.title GROUP BY WLPbib.bibID MySQL Error: 1064 (You have an error in your SQL syntax near 'GROUP BY WLPbib.bibID ' at line 10) Please contact the webmaster and report the exact error message. Session halted. Ken wrote: Mike - I'm not certain but it sounds like you might be looking for GROUP BY. Do GROUP BY and then the columns that are identical in your results. - Ken At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: Hello, I posted this to the general list this morning got a couple of good leads, but they weren't able to actually fix the problem, so I'm posting here to the db list. I'm making some headway on joining three MySQL tables. However, when I run this query: mysql_query(SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName, WLPprofile.lastName, WLPprofile.organization, WLPcountry.languageName FROM WLPbib LEFT JOIN WLPprofile ON WLPprofile.profileID = WLPbib.profileID LEFT JOIN WLPaddress ON WLPaddress.publisherID = WLPbib.publisherID LEFT JOIN WLPcountry ON WLPcountry.countryID = WLPaddress.countryID); I now get results in triplicate. ie. I'm getting three copies of the same title, firstName, organization, etc I somehow suspected that this should be the result with LEFT JOIN, but I'm not sure how to return a query without duplication. This is far better than what I had this morning (which was no response from the server). Thanks. I'm new to joining tables... Someone wrote back suggesting that SELECT DISTINCT could be used to to the job. Another person suggested that using UNIQUE(profileID) would make it look nicer. I wasn't sure how to use UNIQUE with the last JOIN as it isn't directly linked to WLPbib.. Any suggestions would be useful. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
Just build the SQL statement piece by piece instead of all at once. Be sure that your tables are setup properly, allowing you to make joins properly. Try not to rush, cause you might miss a couple of little things along the way. Kevin Johnson - Original Message - From: Mike Gifford [EMAIL PROTECTED] To: Ken [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 08:00 PM Subject: Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables Sorry Ken, I'm trying to learn a few too many things at once. Switching it around eliminated the error message but not the duplication. I'm eliminating as much of the code as I can to see that it isn't coming from PHP. Thanks again for your help. Mike Ken wrote: In general, you should always be reading the manual first. From the SELECT syntax at http://www.mysql.com/doc/S/E/SELECT.html GROUP BY must be indicated before ORDER BY. So reverse the order of those portions. - Ken At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: It looked good, but it gave me an error.. Sorry ... WLPcountry.countryID ORDER BY WLPbib.title GROUP BY WLPbib.bibID MySQL Error: 1064 (You have an error in your SQL syntax near 'GROUP BY WLPbib.bibID ' at line 10) Please contact the webmaster and report the exact error message. Session halted. Ken wrote: Mike - I'm not certain but it sounds like you might be looking for GROUP BY. Do GROUP BY and then the columns that are identical in your results. - Ken At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: Hello, I posted this to the general list this morning got a couple of good leads, but they weren't able to actually fix the problem, so I'm posting here to the db list. I'm making some headway on joining three MySQL tables. However, when I run this query: mysql_query(SELECT WLPbib.bibID, WLPbib.title, WLPbib.publisher, WLPbib.publicationDate, WLPaddress.city, WLPaddress.state, WLPprofile.firstName, WLPprofile.lastName, WLPprofile.organization, WLPcountry.languageName FROM WLPbib LEFT JOIN WLPprofile ON WLPprofile.profileID = WLPbib.profileID LEFT JOIN WLPaddress ON WLPaddress.publisherID = WLPbib.publisherID LEFT JOIN WLPcountry ON WLPcountry.countryID = WLPaddress.countryID); I now get results in triplicate. ie. I'm getting three copies of the same title, firstName, organization, etc I somehow suspected that this should be the result with LEFT JOIN, but I'm not sure how to return a query without duplication. This is far better than what I had this morning (which was no response from the server). Thanks. I'm new to joining tables... Someone wrote back suggesting that SELECT DISTINCT could be used to to the job. Another person suggested that using UNIQUE(profileID) would make it look nicer. I wasn't sure how to use UNIQUE with the last JOIN as it isn't directly linked to WLPbib.. Any suggestions would be useful. Mike -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
altho this may not help at all, rather than bashing away with php+SQL statements, i usually just pilot my sql in phpmyadmin, then once it works with set values (ie SELECT * FROM people WHERE personID='3' rahter than personID='$personID' or something) i can then drop that SQL into my script. HTH Beau // -Original Message- // From: Mike Gifford [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 12 July 2001 11:01 AM // To: Ken // Cc: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] Left Join is producing duplicate // results - MySQL // relational tables // // // Sorry Ken, // // I'm trying to learn a few too many things at once. // Switching it around // eliminated the error message but not the duplication. // // I'm eliminating as much of the code as I can to see that it // isn't coming from PHP. // // Thanks again for your help. // // Mike // // Ken wrote: // // In general, you should always be reading the manual first. // From the SELECT syntax at // http://www.mysql.com/doc/S/E/SELECT.html // GROUP BY must be indicated before ORDER BY. So reverse // the order of those portions. // // - Ken // // At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: // // It looked good, but it gave me an error.. Sorry // ... // WLPcountry.countryID ORDER BY WLPbib.title GROUP BY WLPbib.bibID // // MySQL Error: 1064 (You have an error in your SQL syntax // near 'GROUP BY WLPbib.bibID ' at line 10) // Please contact the webmaster and report the exact error message. // Session halted. // // Ken wrote: // // // Mike - // I'm not certain but it sounds like you might be looking // for GROUP BY. Do GROUP BY and then the columns that are // identical in your results. // - Ken // At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: // // // Hello, // // I posted this to the general list this morning got a // couple of good leads, but they weren't able to actually fix // the problem, so I'm posting here to the db list. // // I'm making some headway on joining three MySQL tables. // // However, when I run this query: // // mysql_query(SELECT // WLPbib.bibID, // WLPbib.title, // WLPbib.publisher, // WLPbib.publicationDate, // WLPaddress.city, // WLPaddress.state, // WLPprofile.firstName, // WLPprofile.lastName, // WLPprofile.organization, // WLPcountry.languageName // // FROM WLPbib // // LEFT JOIN WLPprofile ON WLPprofile.profileID = // WLPbib.profileID // LEFT JOIN WLPaddress ON WLPaddress.publisherID = // WLPbib.publisherID // LEFT JOIN WLPcountry ON WLPcountry.countryID = // WLPaddress.countryID); // // I now get results in triplicate. ie. I'm getting three // copies of the same title, firstName, organization, etc // // I somehow suspected that this should be the result with // LEFT JOIN, but I'm not sure how to return a query without // duplication. // // This is far better than what I had this morning (which // was no response from the server). // // Thanks. I'm new to joining tables... // // Someone wrote back suggesting that SELECT DISTINCT could // be used to to the job. // // Another person suggested that using UNIQUE(profileID) // would make it look nicer. I wasn't sure how to use UNIQUE // with the last JOIN as it isn't directly linked to WLPbib.. // // Any suggestions would be useful. // // Mike // // // // -- // Mike Gifford, OpenConcept Consulting, http://openconcept.ca // Offering everything your organization needs for an // effective web site. // Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ // It is a miracle that curiosity survives formal education. // - A Einstein // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // // // // // // // -- // Mike Gifford, OpenConcept Consulting, http://openconcept.ca // Offering everything your organization needs for an effective // web site. // Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ // It is a miracle that curiosity survives formal education. - // A Einstein // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Left Join is producing duplicate results - MySQL relational tables
phpMyAdmin is great! And I hear that they are coming out with a new version pretty soon (or is it here - haven't checked).. However I don't think that you can join tables in phpMyAdmin.. Perhaps I don't know the app well enough though. Mike Beau Lebens wrote: altho this may not help at all, rather than bashing away with php+SQL statements, i usually just pilot my sql in phpmyadmin, then once it works with set values (ie SELECT * FROM people WHERE personID='3' rahter than personID='$personID' or something) i can then drop that SQL into my script. HTH Beau // -Original Message- // From: Mike Gifford [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 12 July 2001 11:01 AM // To: Ken // Cc: [EMAIL PROTECTED] // Subject: Re: [PHP-DB] Left Join is producing duplicate // results - MySQL // relational tables // // // Sorry Ken, // // I'm trying to learn a few too many things at once. // Switching it around // eliminated the error message but not the duplication. // // I'm eliminating as much of the code as I can to see that it // isn't coming from PHP. // // Thanks again for your help. // // Mike // // Ken wrote: // // In general, you should always be reading the manual first. // From the SELECT syntax at // http://www.mysql.com/doc/S/E/SELECT.html // GROUP BY must be indicated before ORDER BY. So reverse // the order of those portions. // // - Ken // // At 10:35 PM 7/11/01 -0400, Mike Gifford wrote: // // It looked good, but it gave me an error.. Sorry // ... // WLPcountry.countryID ORDER BY WLPbib.title GROUP BY WLPbib.bibID // // MySQL Error: 1064 (You have an error in your SQL syntax // near 'GROUP BY WLPbib.bibID ' at line 10) // Please contact the webmaster and report the exact error message. // Session halted. // // Ken wrote: // // // Mike - // I'm not certain but it sounds like you might be looking // for GROUP BY. Do GROUP BY and then the columns that are // identical in your results. // - Ken // At 09:46 PM 7/11/01 -0400, Mike Gifford wrote: // // // Hello, // // I posted this to the general list this morning got a // couple of good leads, but they weren't able to actually fix // the problem, so I'm posting here to the db list. // // I'm making some headway on joining three MySQL tables. // // However, when I run this query: // // mysql_query(SELECT // WLPbib.bibID, // WLPbib.title, // WLPbib.publisher, // WLPbib.publicationDate, // WLPaddress.city, // WLPaddress.state, // WLPprofile.firstName, // WLPprofile.lastName, // WLPprofile.organization, // WLPcountry.languageName // // FROM WLPbib // // LEFT JOIN WLPprofile ON WLPprofile.profileID = // WLPbib.profileID // LEFT JOIN WLPaddress ON WLPaddress.publisherID = // WLPbib.publisherID // LEFT JOIN WLPcountry ON WLPcountry.countryID = // WLPaddress.countryID); // // I now get results in triplicate. ie. I'm getting three // copies of the same title, firstName, organization, etc // // I somehow suspected that this should be the result with // LEFT JOIN, but I'm not sure how to return a query without // duplication. // // This is far better than what I had this morning (which // was no response from the server). // // Thanks. I'm new to joining tables... // // Someone wrote back suggesting that SELECT DISTINCT could // be used to to the job. // // Another person suggested that using UNIQUE(profileID) // would make it look nicer. I wasn't sure how to use UNIQUE // with the last JOIN as it isn't directly linked to WLPbib.. // // Any suggestions would be useful. // // Mike // // // // -- // Mike Gifford, OpenConcept Consulting, http://openconcept.ca // Offering everything your organization needs for an // effective web site. // Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ // It is a miracle that curiosity survives formal education. // - A Einstein // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // // // // // // // -- // Mike Gifford, OpenConcept Consulting, http://openconcept.ca // Offering everything your organization needs for an effective // web site. // Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ // It is a miracle that curiosity survives formal education. - // A Einstein // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, e-mail: [EMAIL PROTECTED] // For additional commands, e-mail: [EMAIL PROTECTED] // To contact the list administrators, e-mail: // [EMAIL PROTECTED] // -- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything
Re: [PHP-DB] Need a shopping cart
ummm... why not install MYSQL on your server? you can have the apache/mysql/php triad. all free/open sourced... then there are a few shopping carts already written. the book titled, PHP and MySQL Web Development has a shopping cart example... http://shop.barnesandnoble.com/booksearch/results.asp?WRD=PHP+and+MySQL+Web+Developmentuserid=17P90ZH208 Jeff @ HookedOnThe.Net wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Leo G. Divinagracia III [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] pulling my hair out
I have one script that looks like this: ?php setcookie (logged_in, yes, time() - 3600); setcookie (logged_user_name, brad, time() - 3600); ? html head /head body SENT /body /html and another that looks like this: ?php print start br; echo $HTTP_COOKIE_VARS[logged_in]; print br; echo $logged_user_name; print br; print end; ? which I have also tried like this: ?php print br; echo $logged_in; print br; echo $logged_user_name; ? It seems like this should be extremely simple, but when I run the first one, and then the second one, the second one only writes the br's to the document. It also doesnt trigger my browser (tried in netscape and ie5) to alert me that a cookie is being sent, I turned that option on just to test this script. Please Help! Brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] pulling my hair out
Brad Try this: -- ?php $status = 0; if (isset($myTstCky) ($myTstCky == ChocChip)) $status = 1; if (!isset($CCHK)) { setcookie(myTstCky, ChocChip); header(Location: $PHP_SELF?CCHK=1); exit; } ? html headtitleCookie Check/title/head body bgcolor=#FF text=#00 Cookie Check Status: ?php printf ('font color=#%s%s/font ;', $status ? 00FF00 : FF, $status ? PASSED! : FAILED!); ? /body /html --- It's taken from here: http://www.php.net/manual/en/function.setcookie.php If that still fails to work then your PHP config must be awry.. Tom At 21:16 11/07/2001 -0700, you wrote: I have one script that looks like this: ?php setcookie (logged_in, yes, time() - 3600); setcookie (logged_user_name, brad, time() - 3600); ? SENT and another that looks like this: ?php print start br; echo $HTTP_COOKIE_VARS[logged_in]; print br; echo $logged_user_name; print br; print end; ? which I have also tried like this: ?php print br; echo $logged_in; print br; echo $logged_user_name; ? It seems like this should be extremely simple, but when I run the first one, and then the second one, the second one only writes the br's to the document. It also doesnt trigger my browser (tried in netscape and ie5) to alert me that a cookie is being sent, I turned that option on just to test this script. Please Help! Brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] pulling my hair out
Stupid html e-mail... That code may not come through properly... copy it from the site, as what's below is only half complete. Tom At 16:23 12/07/2001 +1200, you wrote: Brad Try this: -- ?php $status = 0; if (isset($myTstCky) ($myTstCky == ChocChip)) $status = 1; if (!isset($CCHK)) { setcookie(myTstCky, ChocChip); header(Location: $PHP_SELF?CCHK=1); exit; } ? Cookie Check Status: ?php printf ('%s ;', $status ? 00FF00 : FF, $status ? PASSED! : FAILED!); ? --- It's taken from here: http://www.php.net/manual/en/function.setcookie.php If that still fails to work then your PHP config must be awry.. Tom At 21:16 11/07/2001 -0700, you wrote: I have one script that looks like this: ?php setcookie (logged_in, yes, time() - 3600); setcookie (logged_user_name, brad, time() - 3600); ? SENT and another that looks like this: ?php print start br; echo $HTTP_COOKIE_VARS[logged_in]; print br; echo $logged_user_name; print br; print end; ? which I have also tried like this: ?php print br; echo $logged_in; print br; echo $logged_user_name; ? It seems like this should be extremely simple, but when I run the first one, and then the second one, the second one only writes the br's to the document. It also doesnt trigger my browser (tried in netscape and ie5) to alert me that a cookie is being sent, I turned that option on just to test this script. Please Help! Brad -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Paging help needed :-(
Hi there Everyone, I currently have a dedicated Apache server with PHP 4.06, MySQL etc .. installed and running fine. Below is alittle peice of code that I would love an answer to: ?php $connection = mysql_connect(Localhost,username!!!,password!!!) or die(Couldn't make a connection.); $db = mysql_select_db(planet, $connection) or die(Couldn't select database.); $sql = SELECT id, email, name, subject, url, image2, comments, dat FROM users ORDER BY id DESC; $sql_result = mysql_query($sql,$connection) or die(Couldn't execute query.); ? ? while ($row = mysql_fetch_array($sql_result)) { $email = $row[email]; $name = $row[name]; $subject = $row[subject]; $url = $row[url]; $image2 = $row[image2]; $comments = $row[comments]; $dat = $row[dat]; $comments=nl2br($comments); include(censorguestbook.php); $ip = getenv (REMOTE_ADDR); ? then all the HTML and display bits (Example at www.planetoxygene.com in the guestbook). ? } mysql_free_result($sql_result); mysql_close($connection); ? Now my question is, how do I do paging in PHP? I need to display 10 entries per page, and be able to go back and forth with them. I'm relatively new to PHP so I would be really grateful for any advice. Thanks everyone, I appreciate it. Chris Payne www.planetoxygene.com
RE: [PHP-DB] Need a shopping cart
Everyone suggesting Easy! Just install Mysql! makes me laugh... :) Jeff-- I suggest you check: 1) http://www.hotscripts.com/ 2) http://www.zend.com/ 3) http://www.sourceforge.com/ 4) http://www.mysql.com/ (Just kidding!) Any shopping cart that uses ODBC should work just fine-- and moreso, it shouldn't be hard (if you absolutely needed to) to modify a Mysql cart to use odbc calls instead. Best of luck! Jeff @ HookedOnThe.Net wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] Need a shopping cart
Here's a list of some free shopping cart stuff http://www.missoulaweb.com/help/index.phtml?qid=46cat=11 -- Allen Lee http://MissoulaWeb.com $10/month PHP4 MySQL Hosting On Thu, 12 Jul 2001, Matthew Loff wrote: Ha ha... It makes perfect sense! I just assumed that since he was asking, he was implying that he didn't have the ability (due to administrative reasons) to install mysql. Good point, though. :) -Original Message- From: Tom Peck [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 1:01 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Need a shopping cart Matthew So what's so funny about installing MySQL on a NT system that is already running Perl and PHP? I think it makes perfect sense :-). Tom At 00:52 12/07/2001 -0400, you wrote: Everyone suggesting Easy! Just install Mysql! makes me laugh... :) Jeff-- I suggest you check: 1) http://www.hotscripts.com/ 2) http://www.zend.com/ 3) http://www.sourceforge.com/ 4) http://www.mysql.com/ (Just kidding!) Any shopping cart that uses ODBC should work just fine-- and moreso, it shouldn't be hard (if you absolutely needed to) to modify a Mysql cart to use odbc calls instead. Best of luck! Jeff @ HookedOnThe.Net wrote: Can anyone direct me to a shopping cart package (preferrably in PHP, although PERL would possibly work) which utilizes either an MS Access database or flat files? I've found several shopping carts, but they all seem to require MySQL which I do not have access to on my server. My server is Windows NT 4 with PHP 4 and PERL 5. I sure hope someone can help. Thanks in advance. Regards, Jeff [EMAIL PROTECTED] - ICQ UIN: 736807 Training, Web Hosting and Design http://www.HookedOnThe.Net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]