Re: [PHP] mysql problems [SOLVED]

2011-05-14 Thread Curtis Maurand
Sean Greenslade wrote: [MASSIVE SNIP] Well, from what I saw while wading through your code, you allow unsanitized variables to be concatenated to your queries. Big no-no! For ANY client-generated variable, always sanitize with mysql_real_escape_string. In fact, sanitize all your

RE: [PHP] mysql problems [SOLVED]

2011-05-14 Thread Jasper Mulder
[SNIP] added and else clause. while ($_parent != 0) { if ($num_rows 0) { perform some action } else { $_parent = 0; } } and that solved the problem. Thank you, everyone for your help. Curtis A small remark: I think it is good programming practice to

Re: Re: [PHP] mysql problems

2011-05-12 Thread Tim Streater
On 11 May 2011 at 19:25, Curtis Maurand cur...@maurand.com wrote: $_cartTotal=$0.00; Surely that should be: $_cartTotal = 0.00; tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP] mysql problems

2011-05-12 Thread Curtis Maurand
Tim Streater wrote: On 11 May 2011 at 19:25, Curtis Maurand cur...@maurand.com wrote: $_cartTotal=$0.00; Surely that should be: $_cartTotal = 0.00; Good pickup.  I missed that.  I didn't write the code, I'm just trying to figure out what's going on. Thanks,  I'll look at that.  --C

[PHP] mysql problems

2011-05-11 Thread Curtis Maurand
I'm running PHP 5.3.6, Mysql 5.1.51 and Apache 2.2.17 I have code that does a simple mysql_query();  the query on the commandline returns an empty set.  when run via PHP and the web server, the page hangs, it never gets to the if (mysql_num_rows($result) 0) {}. and the queries per second on

Re: [PHP] mysql problems

2011-05-11 Thread Marc Guay
Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mysql problems

2011-05-11 Thread Curtis Maurand
Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query, SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat where

Re: [PHP] mysql problems

2011-05-11 Thread Curtis Maurand
Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query, SELECT catagory_parent FROM t_catagories where catagory_ID= . $_currentCat where

Re: [PHP] mysql problems

2011-05-11 Thread Sean Greenslade
On Wed, May 11, 2011 at 2:25 PM, Curtis Maurand cur...@maurand.com wrote: Marc Guay wrote: Does anyone have any ideas? Sounds like it's getting caught in a loop. Post the whole script for best results. It looks like the site is under attack, because I keep seeing the query,

[PHP] mysql problems

2005-03-01 Thread Jed R. Brubaker
Hi all - I could use a lead on a problem. I just don't know where to start. I have a PHP script that populates a database table. No big deal. It creates mailing labels. However, a weird things keeps happening - every once in a while, a query is run twice. It is the same query, same

Re: [PHP] mysql problems

2005-03-01 Thread Richard Lynch
Jed R. Brubaker wrote: I could use a lead on a problem. I just don't know where to start. I have a PHP script that populates a database table. No big deal. It creates mailing labels. However, a weird things keeps happening - every once in a while, a query is run twice. It is the same query,

Re: [PHP] mysql problems

2005-03-01 Thread Rory McKinley
Jed R. Brubaker wrote: Hi all - I could use a lead on a problem. I just don't know where to start. I have a PHP script that populates a database table. No big deal. It creates mailing labels. However, a weird things keeps happening - every once in a while, a query is run twice. It is the same

[PHP] mysql problems, need help quick

2002-06-11 Thread Hawk
I'm filling a database with info, and I'm using id as identifiers in the list, the id is auto increment, and I deleted one entry, now I have a hole in the database, is there any way to fix this? lets say I have 1 2 3 4 5 6 And I deleted 6 Now it looks like 1 2 3 4 5 7 8 9 and so on is there

RE: [PHP] mysql problems, need help quick

2002-06-11 Thread Jon Haworth
Hi Hawk, (snip auto-incrementing PKs) is there somewhere the next number is located ? No. Why would you care, anyway? The thing about PKs is that they have to be unique, not sequential. If you're *really* bothered by it, you'll have to dump the contents of the table to a file, drop the

Re: [PHP] mysql problems, need quick help

2002-06-11 Thread Adam Voigt
Primary Key's, by nature, are designed to always be uniqiue, which means that even if you delete row 6, the next row you insert will be 10 because there is no id 10. If you simply need to get the list of items in a query, in the order they were inserted, I would suggest using something like:

[PHP] mysql problems

2002-03-12 Thread Maarten Weyn
Hi on this code: $link = mysql_connect(localhost, login, passwd); mysql_select_db(table); $result = mysql_query(select * from table); while ($row = mysql_fetch_object($result)) { echo $row-ID; echo $row-Drank; } mysql_free_result($result); mysql_close($link); It resulst in Warning:

Re: [PHP] mysql problems

2002-03-12 Thread hugh danaher
: Tuesday, March 12, 2002 5:19 PM Subject: [PHP] mysql problems Hi on this code: $link = mysql_connect(localhost, login, passwd); mysql_select_db(table); $result = mysql_query(select * from table); while ($row = mysql_fetch_object($result)) { echo $row-ID; echo $row-Drank

RE: [PHP] mysql problems

2002-03-12 Thread Narvaez, Teresa
: . mysql_error()); -Teresa -Original Message- From: hugh danaher [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 12, 2002 8:27 PM To: Maarten Weyn; php Subject: Re: [PHP] mysql problems Maarten, Perhaps table isn't the name of the table you want. If mysql can't find the table (in line 13

[PHP] PHP MySQL problems, updating database..

2002-01-17 Thread Hawk
Having a problem with this, I have a working login that supports multiple users, and I'm trying to make it possible for the users to change their own settings etc, but I get killed when trying to send the data to the MySQL database. To connect I use mysql_connect($host,$user,$pswd) and

Re: [PHP] PHP MySQL problems, updating database..

2002-01-17 Thread Erik Price
The reason you aren't seeing any errors is because you used or die() -- to the best of my knowledge, this replaces any standard errors that PHP would normally generate. It appears that you have omitted the second argument to mysql_query(). A common mistake that I've made many times myself.

Re: [PHP] PHP MySQL problems, updating database..

2002-01-17 Thread Dennis Moore
- From: Hawk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 17, 2002 1:18 PM Subject: [PHP] PHP MySQL problems, updating database.. Having a problem with this, I have a working login that supports multiple users, and I'm trying to make it possible for the users to change their own

Re: [PHP] PHP MySQL problems, updating database..

2002-01-17 Thread Miles Thompson
Hawk, If you have a working login, can we safely assume that there is information in the database for each user? If so, then we won't bother discussing insert statements, but concentrate on updates. We'll also assume that $user has update privileges on the database. The normal form of an