[PHP-DB] Problem with php/mysql and ISS on windows XP profeesional
hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional
Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional
If your missing the dollar sign then add it, if your not, then set error_reporting in your php.ini to E_ALL ~E_NOTICE. On Mon, 2003-06-02 at 10:52, Cal Evans wrote: Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional
Again, changing the error reporting level will not fix the problem. Since he is getting a warning AND his code is acting unexpectedly, he probably needs to concentrate on fixing the problem. (At least I assume that there is a problem. It sounds like there is from his description.) humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:59 AM Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional If your missing the dollar sign then add it, if your not, then set error_reporting in your php.ini to E_ALL ~E_NOTICE. On Mon, 2003-06-02 at 10:52, Cal Evans wrote: Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windowsXPprofeesional
Ok, like I said, if it is an error (like a missing dollar sign) then put the dollar sign in, therefore fixing the problem. However, if there is not an error and he is simply using a variable and PHP is complaining it's not defined, that's not a big deal, thats why it doesn't make the code fail. It just means it noticed you accessed the variable $whatever without making sure it was defined before you checked if it was false, etc. No big deal, thats why the majority of PHP install's set the error_reporting to ignore E_NOTICE, because it's completely safe to do so. On Mon, 2003-06-02 at 10:58, Cal Evans wrote: Again, changing the error reporting level will not fix the problem. Since he is getting a warning AND his code is acting unexpectedly, he probably needs to concentrate on fixing the problem. (At least I assume that there is a problem. It sounds like there is from his description.) humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:59 AM Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional If your missing the dollar sign then add it, if your not, then set error_reporting in your php.ini to E_ALL ~E_NOTICE. On Mon, 2003-06-02 at 10:52, Cal Evans wrote: Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional
here is the code i wrote i didn't miss the $ sign and it works fine on web but returns the error message when i use it on localhost ? @ $db = mysql_connect(localhost); mysql_select_db(cds); $test_tr = mysql_query(select name from newpcgames order by gameid desc LIMIT 0, 10); $test_tr1 = mysql_query(select name from newpcgames order by gameid desc LIMIT 10, 20); while($record = mysql_fetch_array($test_tr)) { $record1= mysql_fetch_array($test_tr1); echo TR bgColor=#475674 TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record[name]); echo /strong/tdtd /td; echo TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record1[name]); echo /strong/td /tr ; } ? From: Cal Evans [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional Date: Mon, 2 Jun 2003 09:52:21 -0500 Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional
Put single quote's around name in your record array, example: Use: $record['name'] Instead Of: $record[name] On Mon, 2003-06-02 at 11:04, Ahmed Abdelaliem wrote: here is the code i wrote i didn't miss the $ sign and it works fine on web but returns the error message when i use it on localhost ? @ $db = mysql_connect(localhost); mysql_select_db(cds); $test_tr = mysql_query(select name from newpcgames order by gameid desc LIMIT 0, 10); $test_tr1 = mysql_query(select name from newpcgames order by gameid desc LIMIT 10, 20); while($record = mysql_fetch_array($test_tr)) { $record1= mysql_fetch_array($test_tr1); echo TR bgColor=#475674 TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record[name]); echo /strong/tdtd /td; echo TD onmouseover=\this.bgColor='00'\ onmouseout=\this.bgColor='475674'\ bgColor=#475674 width=\50%\ DIV align=leftFONT color=#ff size=1strong; echo stripslashes($record1[name]); echo /strong/td /tr ; } ? From: Cal Evans [EMAIL PROTECTED] To: Ahmed Abdelaliem [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional Date: Mon, 2 Jun 2003 09:52:21 -0500 Sounds like you left off a $ when using a variable. I would take a look at line 158, find the variable name and make sure it's $name. Disabling the error will cause the message to go away but not fix the problem. humbly, =C= * Cal Evans * http://www.christianperformer.com * Stay plugged into your audience * The measure of a programmer is not the number of lines of code he writes but the number of lines he does not have to write. * - Original Message - From: Ahmed Abdelaliem [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:50 AM Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional hi i use php and mysql on IIS server on windows xp professional when i select anything from the database i get this : Notice: Use of undefined constant name - assumed 'name' in d:\inetpub\wwwroot\EGYCDS\index.php on line 158 Spy Hunter while evrything is going fine when i upload it on the web and it returns only Spy Hunter i think i have to disable this eroor message only can any one tell me how i disable that error message _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Total Values with MySQL
Hi, Is it possible to get MySQL to total the values of a select statement, say 'SELECT ColumnName FROM Table WHERE ColumnName = '1'' Say I have three values in ColumnName all of '1' then can I get MySQL to return 3? Thanks for your help -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Total Values with MySQL
SELECT SUM(ColumnName) AS total FROM table WHERE ColunName = '1'; On Mon, 2003-06-02 at 11:18, shaun wrote: Hi, Is it possible to get MySQL to total the values of a select statement, say 'SELECT ColumnName FROM Table WHERE ColumnName = '1'' Say I have three values in ColumnName all of '1' then can I get MySQL to return 3? Thanks for your help -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Total Values with MySQL
Hi Shaun Comments inline... On 02 Jun,2003 at 16:18 shaun shaun wrote: Hi, Is it possible to get MySQL to total the values of a select statement, say 'SELECT ColumnName FROM Table WHERE ColumnName = '1'' Say I have three values in ColumnName all of '1' then can I get MySQL to return 3? Try the SUM() function as in:- SELECT SUM(ColumnName) AS Total FROM Table WHERE ColumnName = '1'; ?? Thanks for your help No problem Ronan e: [EMAIL PROTECTED] t: 01903 739 997 w: www.thelittledot.com The Little Dot is a partnership of Ronan Chilvers and Giles Webberley -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] query string
Awsome! Thanks, That is exactly what I was looking for. Work great now! Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] To answer your question, you should urlencode() the team name. However, I would store the user in a cookie or session, and fetch the team name on each page load. Otherwise, they can easily change which team they're using. Ian Fingold wrote: Sorry I don't think I explained very well... heres my situation... I have a mysql database set up... I have a user table with 2 fields...team_name and fant_week. What I want to do is, depending on who is logged in, I want my link to change the value of 'team' to the logged in members team name, like wise for the week. For example.. if gorno is logged in and his team is called fun team the link will reflect his team and look like this... fant_stnd3.php?week=1team=fun team or if say... billbo is logged in and his team is called silly team the link will look like this fant_stnd3.php?week=1team=silly team but again, my problem is that it's cutting off the team value when there is a space in the string.. G|rhan Vzen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sun, 2003-06-01 at 22:26, Ian Fingold wrote: I'm trying to build a query string for one of my links.. for example... fant_stnd3.php?week=1team=fun%20team I need to be able to grab the values of 'week' and 'team' from an array, I can do that no problem, but when the code runs it cuts off the value if there is a space in the string. so instead of putting fun team in the query string it cuts it off and just puts.. fun So my question, is there a function or any way to prevent this from happening? thanks. Hi Ian, I have no idea what you are trying to do.. Well if you are getting those values from a URL, $week and $team variables in your php script should have the values in them.. In later versions of PHP, they will be _POST['week'] and _POST['team'] or _GET['week'] or _GET['team'] depending on which method is used.. You don't need to parse the URL and run them through an array.. :) Gurhan -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] another redirecting question
Hi Grant.. I've tested it and it doesn't resubmit this information a second time. I have a page called submit.php where users can upload pictures. Once they submit, it goes to submitpics.php for processing and creates a session. Then it's redirected to submit.php which reads the session and destroys it after it read it. All in all, it is as if submitpics.php never existed. metin At 10:52 AM 5/30/2003 -0500, Grant Rutherford wrote: Hi I did actually encounter that problem. However, wouldn't redirecting properly still allow the user to resubmit the information using the back button? I solved this problem a different way by setting and clearing session variables on entry and exit to a series of pages. Grant On Fri, 2003-05-30 at 10:25, Metin Kale wrote: Well, if you're inserting some data into a database and the person refreshes the page, it would re-insert the data again into the database. Including the page like you did at the end wouldn't change that fundamental problem, hence why you'd want to have it redirect to another page. Metin At 10:20 AM 5/30/2003 -0500, Grant Rutherford wrote: I'm very new to PHP so somebody correct me please if this is a bad idea... I had the same problem and I ended up just including the second page at the end of the first one: ?php // some stuff (output if necessary) include 'nextpage.php'; die(); ? Grant On Fri, 2003-05-30 at 09:43, Rick Dahl wrote: The scripts I need to run before I redirect automatically send output to the browser. I cannot alter these scripts. Is there a way around this? Rick -- Grant Rutherford Iders Incorporated 600A Clifton Street Winnipeg, MB Canada R3G 2X6 http://www.iders.ca tel: 204-779-5400 ext 36 fax: 204-779-5444 This message is intended solely for the use of the designated recipient(s) and their appointed delegates, and may contain confidential information. Any unauthorized disclosure, copying or distribution of its contents is strictly prohibited. If you have received this message in error, please destroy it and advise the sender immediately by phone, email or facsimile. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Array Question
Hello everyone. If I wanted to pass a item ID along with a quantity to an associative array called CartArray how would I pass it to the PHP script? I'll get this shopping cart working yet !! Cheers, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Array Question
CartArray['itemid'] = $itemid; note where $qty = CartArray['qty']; /note Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Boa Constructor [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:27 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Array Question Hello everyone. If I wanted to pass a item ID along with a quantity to an associative array called CartArray how would I pass it to the PHP script? I'll get this shopping cart working yet !! Cheers, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Array Question
RE: [PHP-DB] Array QuestionCheers Gary, and in the html would I put something like: a href=myscript.php?itemid=1qty=2buy this item/a Simple question I know! Jay, yup thats all I want to do, just assign two values into an array. Thank you, Graeme :) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Monday, June 02, 2003 8:30 PM Subject: RE: [PHP-DB] Array Question CartArray['itemid'] = $itemid; note where $qty = CartArray['qty']; /note Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Boa Constructor [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2003 2:27 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Array Question Hello everyone. If I wanted to pass a item ID along with a quantity to an associative array called CartArray how would I pass it to the PHP script? I'll get this shopping cart working yet !! Cheers, Graeme :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Stuck on table design
I have a system I'm building. There are several applications. For each application there are one OR two reviewers. For each reviewer, there is a team leader, and for each team leader there is an administrator. Applications primary key is ApplicationID. Two reviewers can edit their own application at any time until they submit it to the team leader. At that point the team leader can send it back to the reviewer, make changes or send back to the reviewer, or approve and send to the administrator. Can anyone suggest a table which would allow me to check for, at any given time, who controls the application? The reason I'm running into a wall is because there is 1 application, but two reviewers scoring that application; both scores must be saved, and reviewer A must be able to send to the team leader without affecting reviewer B's ability to continue to edit/score. I've come up with this: AppID int // refers to application table admin int // refers to the personnel ID in personnel table teamleadint // same reviewerint // same owner enum(admin,teamlead,reviewer) // actually is a tinyint that refers to a role table for full normalcy For each application, and for each reviewer, a row would be added. The reviewer would have full control until the owner field changed to teamlead. This is the only way I can think of to do what I'm looking for. I also have an assignments table, where I have: AppID TeamMemberID roleid so I know for each application, a person is assigned a role. There can be multiple reviewers, so there is no unique key on these columns. Any other suggestions? --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Array Question
Hello everyone. If I wanted to pass a item ID along with a quantity to an associative array called CartArray how would I pass it to the PHP script? I'll get this shopping cart working yet !! If the question is how do you pass an array to another PHP page, you serialize() and urlencode() it, then pass it in the URL. On the following page you unserialize() it. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Adding elements to array question
Hey again all, right I've tried using an associative array for my shopping cart and I've encountered two problems - so far. The first problem is that I can't only add one item to the cart and the second problem is that when viewing the cart it shows two items in it. I think this is because there are two parts to the array, buy and quantity and when I'm counting the amount of items in the array its counting all the components of the array. How can I add items to the end of this associative array? Some of the code I'm using is below. I'm also thinking that if the below code works then there is something wrong with the way I'm reading back the items in the cart. Ugh I dunno! Any ideas? Cheers, Graeme :) ?PHP session_start(); session_name('shoppingcart'); if($buy != ) { $shoppingcart = array( 'buy'='$buy', 'quantity'='$quantity' ); session_register('shoppingcart'); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re : File Input From Form Not Detected
Hi everyone. Thanks for helping Turned out the problem was my upload_tmp_dir. So there you go.. heh Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Reserve Username while Confirming Signup
Hi All, I have a sign up page and when the user submit, it goes to a confirmation page, before the person actually submits. The confirmation page stores the username and password in the Session variable and the submit page stores it into the database by getting it from the session. The rest of the information (eg. address) is resubmited via hidden input type. The question is : I want to reserve the username for the person(say A) while he/she is in the confirmation page and perhaps going back to edit some stuff. What is the best way to do that? I tried putting it in my database in a Logintemp table. With the same fields as the Login table. When the user submits, the Logintemp contents is moved to the Login table. The problem is what if while A is staring at the screen the computer hangs. How do I know if he/she closes the page altogether. I need to delete the contents of Logintemp since it was not moved to Login. Is there any other better way to do this? Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Reserve Username while Confirming Signup
I'm inexperienced with db's, but here are my thoughts: Maybe add a TIMESTAMP(14) field in your temp table, then run a script periodically to delete any rows stored that are more than, say, 20 mins old? Gav -Original Message- From: Dewi Wahyuni [mailto:[EMAIL PROTECTED] Sent: Tuesday, 3 June 2003 1:48 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Reserve Username while Confirming Signup Hi All, I have a sign up page and when the user submit, it goes to a confirmation page, before the person actually submits. The confirmation page stores the username and password in the Session variable and the submit page stores it into the database by getting it from the session. The rest of the information (eg. address) is resubmited via hidden input type. The question is : I want to reserve the username for the person(say A) while he/she is in the confirmation page and perhaps going back to edit some stuff. What is the best way to do that? I tried putting it in my database in a Logintemp table. With the same fields as the Login table. When the user submits, the Logintemp contents is moved to the Login table. The problem is what if while A is staring at the screen the computer hangs. How do I know if he/she closes the page altogether. I need to delete the contents of Logintemp since it was not moved to Login. Is there any other better way to do this? Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Reserve Username while Confirming Signup
You don't need PostgreSQL for transactions. InnoDB tables in MySQL will work just fine. I do agree that this begs for a transaction setup. The transactions will confirm the transfer of everything from the temp to regular table. Then use a timestamp in conjunction with a sweeper script to remove all entries in the temp table more than 7 days old. I think that's a fair time for someone to confirm their information and it allows easily a scheduled operation. Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: Boa Constructor [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, 03 June, 2003 00:00 Subject: Re: [PHP-DB] Reserve Username while Confirming Signup Sounds like ya wanna use a database that supports transactions, PostgreSQL supports it. I'm kinda new to this so I'd check it out but I think this could be what yer after. Cheers, Graeme :) - Original Message - From: Dewi Wahyuni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 4:47 AM Subject: [PHP-DB] Reserve Username while Confirming Signup Hi All, I have a sign up page and when the user submit, it goes to a confirmation page, before the person actually submits. The confirmation page stores the username and password in the Session variable and the submit page stores it into the database by getting it from the session. The rest of the information (eg. address) is resubmited via hidden input type. The question is : I want to reserve the username for the person(say A) while he/she is in the confirmation page and perhaps going back to edit some stuff. What is the best way to do that? I tried putting it in my database in a Logintemp table. With the same fields as the Login table. When the user submits, the Logintemp contents is moved to the Login table. The problem is what if while A is staring at the screen the computer hangs. How do I know if he/she closes the page altogether. I need to delete the contents of Logintemp since it was not moved to Login. Is there any other better way to do this? Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Dealing with ENUM fields
This is for another menu project that I'm working on. The restaurant has a large list of daily specials, all of which fit into one of four categories (lunch, dinner, pizza, dessert). Because the data will never mix (no need for joins or unions), I wanted to keep the specials categories separate from the regular menu item categories. Because there are only four specials categories and they are static, I thought ENUM would work best. Your opinions? Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: Lisi [EMAIL PROTECTED] To: Becoming Digital [EMAIL PROTECTED]; PHP-DB [EMAIL PROTECTED] Sent: Monday, 02 June, 2003 06:40 Subject: Re: [PHP-DB] Dealing with ENUM fields What's the application? What are the issues with using ENUM verses something else? -Lisi At 05:32 AM 6/2/03 -0400, Becoming Digital wrote: Thanks to both Heilo and Lisi. These scripts should make things easier. Is it safe to assume that we are in agreement about the use of an ENUM field for this application? Edward Dudlik Becoming Digital www.becomingdigital.com - Original Message - From: heilo [EMAIL PROTECTED] To: PHP-DB [EMAIL PROTECTED] Sent: Monday, 02 June, 2003 05:11 Subject: Re: [PHP-DB] Dealing with ENUM fields Hi! there is a much shorter way to do this (which works with ENUM and SET): $qry = 'SHOW COLUMNS FROM `gruzilla_content` LIKE module'; $res = mysql_query($qry); if(mysql_num_rows($res)0) { $row = mysql_fetch_row($res); $pattern = #(enum|set)\('(.+?)'\)#i; $replace = '\\2'; $row[1] = preg_replace($pattern, $replace, $row[1]); $options = explode(',', $row[1]); } $options now contains every value of the enum. I think there is also a possibility to do this within a query - but currently i do not find the script on my HD :) - so this is a nice workaround! .ma Lisi [EMAIL PROTECTED] [EMAIL PROTECTED] 11:53 Uhr: I am forwarding this useful function someone once sent to the list that I use often. Hope this fits your needs. -Lisi -Original Message- From: Russ [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 26, 2002 7:47 PM To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] Populating a dropdown list with ENUM values... G'day Scott: I wrote this function to do just what you're atfer: You may need to mess with it for you're own needs - but go for your life! //function: enum_select() - automatically generate an HTML select menu from a MySQL ENUM field //1). takes a table name: '$table' //2). a name for the menu '$name' //3). a CSS class function enum_select($table,$name,$class) { $sql = SHOW COLUMNS FROM $table; $result = mysql_query($sql); $select = select name=\$name\ class=\$class\\n\t; while($myrow = mysql_fetch_row($result)){ $enum_field = substr($myrow[1],0,4); if($enum_field == enum){ global $enum_field; $enums = substr($myrow[1],5,-1); $enums = ereg_replace(',,$enums); $enums = explode(,,$enums); foreach($enums as $val) { $select .= option value=\$val\$val/option\n\t; }//end foreach }//end if }//end while $select .= \r/select; return $select; }//end function All the best. Russ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Matthias Steinböck Email: [EMAIL PROTECTED] Web: http://www.abendstille.at Frühabendliches Webdesign. -- Im Übrigen sind wir der Meinung, dass unsere Gesellschaft Gabel-diskriminierend Löffel verwendet. Alle Macht den Gabeln! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MS Access DSN for PEAR DB::connect
Hi!Does anyone know what DSN I must use to get connected to my MS Access database? BUSINESS is my OBDC connection on Windows 2000 to my database. As PHP database type I use 'odbc'. Please find the enclosed code snipet: getMessage());} ? When running it, I receive an DB Error: connect failed. Unfortunately with same result, I tried the following DSN:$dsn = odbc:///BUSINESS; $dsn = odbc://localhost/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; Any hints from you are very welcome, regards, bjoon - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo.
[PHP-DB] MS Access DSN for PEAR DB::connect
Sorry, the first email was unreadable, Here again! pDoes anyone know what DSN I must use to get connected to my MS Access database?/p p BUSINESS is my OBDC connection on Windows 2000 to my database. As PHP database type I use 'odbc'. /p p ?php require_once('DB.php'); $dsn = odbc:///BUSINESS; $db = DB::connect($dsn); if (DB::isError($db)) { die ($db-getMessage()); } ? /p p I tried the following DSN, unfortunately with same result: $dsn = odbc:///BUSINESS; $dsn = odbc://localhost/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; $dsn = odbc://[EMAIL PROTECTED]/BUSINESS; /p p Any hints from you are very welcome, regards, bjoon /p - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo.
[PHP-DB] authentication problems
Hi to all, I upgrade from Red Hat 7.2 to 7.3, but now I'm facing a problem. Most of my pages use user authentication popup window. For some reason I can't get access to my pages even though I type in the right user name and password. The code for the pages remains the same, I haven't changed anything since it was Red Hat 7.2. The window keep asking for username and password until display the message that I'm unauthorized user. I've been trying different approaches, but I haven't been successful. Even I have created a script to create just the popup window to see what values I'm passing, but still does the same thing. Does anybody have come across on something like this? Thanks in advance Nato here is the code to display the values that I type in ?php // Check to see if $PHP_AUTH_USER already contains info if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm=My Private Stuff'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } // If not empty, display values for variables else { echo PYou have entered this username: $PHP_AUTH_USERbr You have entered this password: $PHP_AUTH_PWbr The authorization type is: $PHP_AUTH_TYPE/p ; } ? Nato Castro Web Development COmputing TechnologieS, Inc. 3028 Javier Road, Suite 400 Fairfax, VA 22031 Tel: 703.280.8800 ext.1205 www.cots.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Reserve Username while Confirming Signup
I like that idea the best... Just insert into your DB with their requested login name and password. Have a timestamp field AND a registration completed field or a status field. I used to do this for people who had registered but had not come back to the site to verify that they recieved their confirm email. No need for two tables -- just use one with a status field so you can say select * from user where status='regnotdone' and date_add(updated, interval 20 minutes)now() This gives you all the users that have not completed their registration, and have not done anything to update their account in the last 20 minutes. Pick your time interval. updated is type timestamp. When they complete their registration, change the status to 'completed' or 'unverified' or something like that -- come up with as many statuses as you want. But don't use another table -- that's a waste. Besides, if you define username as a unique index, then your DB will prevent duplicate usernames -- always good. Peter On Tue, 3 Jun 2003, Gavin Amm wrote: I'm inexperienced with db's, but here are my thoughts: Maybe add a TIMESTAMP(14) field in your temp table, then run a script periodically to delete any rows stored that are more than, say, 20 mins old? Gav -Original Message- From: Dewi Wahyuni [mailto:[EMAIL PROTECTED] Sent: Tuesday, 3 June 2003 1:48 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Reserve Username while Confirming Signup Hi All, I have a sign up page and when the user submit, it goes to a confirmation page, before the person actually submits. The confirmation page stores the username and password in the Session variable and the submit page stores it into the database by getting it from the session. The rest of the information (eg. address) is resubmited via hidden input type. The question is : I want to reserve the username for the person(say A) while he/she is in the confirmation page and perhaps going back to edit some stuff. What is the best way to do that? I tried putting it in my database in a Logintemp table. With the same fields as the Login table. When the user submits, the Logintemp contents is moved to the Login table. The problem is what if while A is staring at the screen the computer hangs. How do I know if he/she closes the page altogether. I need to delete the contents of Logintemp since it was not moved to Login. Is there any other better way to do this? Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail! http://login.mail.lycos.com/r/referral?aid=27005 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Dealing with ENUM fields
Will there ever be 5 specials categories? 6? I like enums for strings, but for more complex sites I go with a separate table for even 4 categories. I don't actually know what happens if you change lunch to pre-dinner on the enum column -- does everything remain as enum selection #1 and change to pre-dinner or do things get messed up? If you already have a categories table, just add one more column -- specials which is a tinyint default 0 -- those 4 categories are set to non-zero (or 1 (that's one)). This needs no more tables, no specialized enums, and you are reusing an existing table structure. I like that better. But either way works. ALSO NOTE! If you use enums for numbers, such as '0', '1', they are treated as strings. I don't believe you can make an enum treat a number as a numeric. ALTER TABLE `reviewdates` ADD `asdf` ENUM( 0, 1 ) NOT NULL You have an error in your SQL syntax near '0,1) NOT NULL' at line 1 Peter On Tue, 3 Jun 2003, Becoming Digital wrote: This is for another menu project that I'm working on. The restaurant has a large list of daily specials, all of which fit into one of four categories (lunch, dinner, pizza, dessert). Because the data will never mix (no need for joins or unions), I wanted to keep the specials categories separate from the regular menu item categories. Because there are only four specials categories and they are static, I thought ENUM would work best. Your opinions? Edward Dudlik Becoming Digital www.becomingdigital.com --- Peter Beckman Internet Guy [EMAIL PROTECTED] http://www.purplecow.com/ --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Access denied for user: '@localhost'
Hi, this problem seems to have appeared after a system upgrade ... command line works fine mysql -uschool -pbonfire school BUT ?php /* Connecting, selecting database */ $link = mysql_connect(localhost, school, bonfire) or die(Could not connect : . mysql_error()); print Connected successfully; mysql_select_db(school) or die(Could not select database. mysql_error()); ? results in the following error Connected successfully Could not select database Access denied for user: '@localhost' to database 'school' the logfile shows this ... 030602 18:47:01 33 Connect [EMAIL PROTECTED] as anonymous on 33 Init DB Access denied for user: '@localhost' to database 'school' 33 Quit Any ideas why the connection is being made as anonymous instead of with the details supplied ??? I'm running debian/testing which is up to date and all relavent systems are default install with some config changes... I've tried re-building from scratch apache + php using the latest tarballs (installed to a different location) and still get the same error I've also tried connecting to a different mysql server (same error) - in fact php still tries to connect to localhost ! I'll try installing a new version of mysql ... but any other ideas would be much appreciated -- Sean -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php