Re: [PHP-DB] NULL to 0 result

2010-12-14 Thread Bastien Koert
On Tue, Dec 14, 2010 at 4:53 PM, Ron Piggott wrote: > > What change is needed to this query so if “currently_in_rss” is NULL it will > be assigned a value of 0 > > SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM > `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_fee

[PHP-DB] NULL to 0 result

2010-12-14 Thread Ron Piggott
What change is needed to this query so if “currently_in_rss” is NULL it will be assigned a value of 0 SELECT `reference`, COUNT(`reference`) AS currently_in_rss FROM `ministry_profiles` WHERE `rss_feed_include` = 1 GROUP BY `rss_feed_include` Ron The Verse of the Day “Encouragement from God’s

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 13:43, Toby Hart Dyke wrote: > > Use  'ALTER tablename AUTO_INCREMENT=1' rather than 'UPDATE tablename > AUTO_INCREMENT=1'. Yeah, again, my fault. Not enough coffee on this cold (~7F) winter's day, perhaps. -- Network Infrastructure Manager Documentation, Webmaster

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 13:02, Ethan Rosenberg wrote: >> >>    UPDATE tablename AUTO_INCREMENT=1; > > mysql> update Visit3 auto_increment=1; > ERROR 1064 (42000): You have an error in your SQL syntax; check the manual > that corresponds to your MySQL server version for the right syntax to use > ne

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Toby Hart Dyke
On 12/14/2010 1:02 PM, Ethan Rosenberg wrote: At 12:38 PM 12/14/2010, Daniel Brown wrote: On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. > The primary key is now 24

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Ethan Rosenberg
At 12:38 PM 12/14/2010, Daniel Brown wrote: On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. > The primary key is now 2421. I have deleted all the data in the table and

Re: [PHP-DB] Resetting auto_increment

2010-12-14 Thread Daniel Brown
On Tue, Dec 14, 2010 at 12:34, Ethan Rosenberg wrote: > Dear List - > > Thanks for all your help. > > How do I reset auto_increment so that the primary key will start from 1. >  The primary key is now 2421.  I have deleted all the data in the table and > started over, and the primary key just incr

[PHP-DB] Resetting auto_increment

2010-12-14 Thread Ethan Rosenberg
Dear List - Thanks for all your help. How do I reset auto_increment so that the primary key will start from 1. The primary key is now 2421. I have deleted all the data in the table and started over, and the primary key just increments from its previous value. Setting auto_increment=0 does

[PHP-DB] Re: RE: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Sascha Meyer
Hi Oliver, Oliver wrote: > > Okay, thank you all again for your input, I have tried a number of > suggestions to work out what is happening. Just to reiterate here is the > search > form which is on a different page. > ... Try the following code on your search page to display GET- and POST-vari

[PHP-DB] RE: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Oliver Kennedy
Okay, thank you all again for your input, I have tried a number of suggestions to work out what is happening. Just to reiterate here is the search form which is on a different page. Search by Client ID shown below is the datasearch.php page '; echo $term . ''; $result = mysql_query($q

[PHP-DB] Re: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Lester Caine
Oliver Kennedy wrote: $query = "SELECT * FROM clients WHERE clientid = '%".$term"%'"; $query = "SELECT * FROM clients WHERE clientid = '%".$term."%'"; Note missing '.' But that should be the same as $query = "SELECT * FROM clients WHERE clientid LIKE '".$term."'"; -- Lester Caine - G8HFL -

[PHP-DB] RE: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Oliver Kennedy
David, Sascha thank you both for your help. Using the query $query = "SELECT * FROM clients WHERE clientid = '$term'"; echo $query . ''; $result = mysql_query($query); as suggested printed out the below SELECT * FROM clients WHERE clientid = '' This seems to indicate that it is not seeing

[PHP-DB] Re: [PHP-WIN] Re: PHP Search DB Table

2010-12-14 Thread Sascha Meyer
David wrote: > > Oliver Kennedy wrote: > > ... > > I have a very simple database consisting of 1 table, I want users here > to > > be able to use a search function to query the database in order to > return > > the information on a client by a specific ID number if it is in the > > database. > > .

[PHP-DB] Re: PHP Search DB Table

2010-12-14 Thread David Robley
Oliver Kennedy wrote: > > > Hello Everyone > > Apologies if I have not done this in the correct way, this is the first > time I have turned to your for help so I am unaware if I have to submit > this according to a certain protocol, if that is the case then please let > me know and I will go t

[PHP-DB] PHP Search DB Table

2010-12-14 Thread Oliver Kennedy
Hello Everyone Apologies if I have not done this in the correct way, this is the first time I have turned to your for help so I am unaware if I have to submit this according to a certain protocol, if that is the case then please let me know and I will go through the proper channels. My probl