Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Jim Lucas
ad...@buskirkgraphics.com wrote: > Before most of you go on a rampage of how to please read below... > > As most of you already know when using MySQL from the shell you can write > your queries in html format in an out file. > > Example: shell>mysql -uyourmom -plovesme --html > This now will r

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: $ddvery"; ?> Not are the results safe but the unlimited possibilites are amazing. Thanks so much for the kick sta

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread admin
I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: $ddvery"; ?> Not are the results safe but the unlimited possibilites are amazing. Thanks so much for the kick starter ad...@buskirkgraphics.com wr

[PHP] Re: php/mysql Query Question.

2009-09-16 Thread Peter Ford
ad...@buskirkgraphics.com wrote: > Before most of you go on a rampage of how to please read below... > > As most of you already know when using MySQL from the shell you can write > your queries in html format in an out file. > > Example: shell>mysql -uyourmom -plovesme --html > This now will r

Re: [PHP] php/mysql Query Question.

2009-09-15 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: Would you mind giving me an example of this that i can stick right into a blank php file and run. I get what you are saying but i cant seem to make that even echo out the data. php 5.2 mysql 5.1.3 Apache 2.2 Cheers, Rob. -- http://www.interjinn.com Applica

Re: [PHP] php/mysql Query Question.

2009-09-15 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shell>mysql -uyourmom -plovesme --html This now will return all

[PHP] php/mysql Query Question.

2009-09-15 Thread admin
Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shell>mysql -uyourmom -plovesme --html This now will return all results in an html format from all qu

Re: [PHP] mySQL query question

2008-11-16 Thread Jim Lucas
Chris wrote: Jim Lucas wrote: [EMAIL PROTECTED] wrote: Ok, so just that I am clear, you are SELECTing and pulling all the data that you are submitting in the above INSERT statement from the DB initially, then you are only modifying the confirm_number value and then re- submitting all the valu

Re: [PHP] mySQL query question

2008-11-16 Thread Chris
Jim Lucas wrote: [EMAIL PROTECTED] wrote: Ok, so just that I am clear, you are SELECTing and pulling all the data that you are submitting in the above INSERT statement from the DB initially, then you are only modifying the confirm_number value and then re- submitting all the values, as they or

Re: [PHP] mySQL query question

2008-11-15 Thread Jim Lucas
Michael S. Dunsavage wrote: On Fri, 2008-11-14 at 12:46 -0800, Jim Lucas wrote: SELECT @confirm_number AS confirm_number; Are we not SELECTING the column value here? should we be selecting confirm_number as confirm_number? The idea is to give you the number that was used in the INSERT sta

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 12:46 -0800, Jim Lucas wrote: > SELECT @confirm_number AS confirm_number; Are we not SELECTING the column value here? should we be selecting confirm_number as confirm_number? -- Michael S. Dunsavage -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
Jim Lucas wrote: > Michael S. Dunsavage wrote: >> On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: '{$Comments}', @confirm_number ) >>> The above should be this instead >>> >>> @confirm_number >>> ); >> Even after f

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
Michael S. Dunsavage wrote: > On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: >>> '{$Comments}', >>> @confirm_number >>> ) >> The above should be this instead >> >> @confirm_number >> ); > > Even after fixing that, nothing gets

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote: > > '{$Comments}', > > @confirm_number > > ) > > The above should be this instead > > @confirm_number > ); Even after fixing that, nothing gets inserted into the database. I've b

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
Jim Lucas wrote: > [EMAIL PROTECTED] wrote: >>> Ok, so just that I am clear, you are SELECTing and pulling all the data >>> that you are submitting in the above INSERT statement from the DB >>> initially, >>> then you are only modifying the confirm_number value and then re- >>> submitting all the

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
[EMAIL PROTECTED] wrote: >> Ok, so just that I am clear, you are SELECTing and pulling all the data >> that you are submitting in the above INSERT statement from the DB >> initially, >> then you are only modifying the confirm_number value and then re- >> submitting all the values, as they origina

Re: [PHP] mySQL query question

2008-11-14 Thread mikesd1
>Ok, so just that I am clear, you are SELECTing and pulling all the data >that you are submitting in the above INSERT statement from the DB >initially, >then you are only modifying the confirm_number value and then re- >submitting all the values, as they originally were, Well, actually when all

Re: [PHP] mySQL query question

2008-11-14 Thread Bastien Koert
On Fri, Nov 14, 2008 at 1:22 PM, <[EMAIL PROTECTED]> wrote: > update contacts set confirm_number = confirm_number + 1 order by >> contact >> >>> desc limit 1 >>> >> > Here is the php query I've been using to send the record in the first > place > > $query="INSERT INTO contacts (first_name, last_na

Re: [PHP] mySQL query question

2008-11-14 Thread Jim Lucas
[EMAIL PROTECTED] wrote: >> update contacts set confirm_number = confirm_number + 1 order by >> contact >>> desc limit 1 > > Here is the php query I've been using to send the record in the first > place > > $query="INSERT INTO contacts (first_name, last_name, email, phn_number, > address, city, s

Re: [PHP] mySQL query question

2008-11-14 Thread mikesd1
update contacts set confirm_number = confirm_number + 1 order by contact desc limit 1 Here is the php query I've been using to send the record in the first place $query="INSERT INTO contacts (first_name, last_name, email, phn_number, address, city, state, zip, dates, comments, confirm_number)

Re: [PHP] mySQL query question

2008-11-14 Thread Bastien Koert
On Fri, Nov 14, 2008 at 9:58 AM, <[EMAIL PROTECTED]> wrote: > > > okay I want to pull an integer from a database called confirm_number, > > add 1 and repost it back to the database > > No, you don't want to do that. > :-) > > You are introducing a race condition between TWO users who hit the same

[PHP] mySQL query question

2008-11-14 Thread ceo
> okay I want to pull an integer from a database called confirm_number, > add 1 and repost it back to the database No, you don't want to do that. :-) You are introducing a race condition between TWO users who hit the same page at the same time. They each get, say, 42, and they each pu

Re: [PHP] mySQL query question

2008-11-14 Thread Martijn Korse
I would create a separate table for this (confirmation_numbers or something) with an autoincrement primary key. That way you can simply insert a new record for you contact and then ask (using mysql_insert_id()) what the confirmation number is. This approach is much safer as you can be 100% sure th

Re: [PHP] mySQL query question

2008-11-14 Thread Thodoris
okay I want to pull an integer from a database called confirm_number, add 1 and repost it back to the database here's the code I'm using. $queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC LIMIT 1"; I assume that you are already aware that if you set the variable

Re: [PHP] mySQL query question

2008-11-14 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 08:46 +0100, Jochem Maas wrote: > 1000 + 1 != 10001 > > you might consider setting a default of 1000 or 1 or whatever on > the given > field so it's automatically populated with that number when a contact > record is > created. Sorry. Hit the 0 one to few times. -- Mich

Re: [PHP] mySQL query question

2008-11-13 Thread Jochem Maas
Michael S. Dunsavage schreef: > okay I want to pull an integer from a database called confirm_number, > add 1 and repost it back to the database > > > here's the code I'm using. > > > $queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC > LIMIT 1"; > $confirmresult=$querycon

Re: [PHP] mySQL query question

2008-11-13 Thread Michael S. Dunsavage
On Fri, 2008-11-14 at 00:52 -0600, Micah Gersten wrote: > If you're just adding one, there is no reason to retrieve the data, > process it, and update it. You can just update the number. > http://dev.mysql.com/doc/refman/5.0/en/update.html But, the problem is that the confirm_number is a confirma

Re: [PHP] mySQL query question

2008-11-13 Thread Micah Gersten
If you're just adding one, there is no reason to retrieve the data, process it, and update it. You can just update the number. http://dev.mysql.com/doc/refman/5.0/en/update.html Also, you should read the MySQL manual on default values: http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.h

[PHP] mySQL query question

2008-11-13 Thread Michael S. Dunsavage
okay I want to pull an integer from a database called confirm_number, add 1 and repost it back to the database here's the code I'm using. $queryconfirm="SELECT confirm_number from contacts ORDER BY contact DESC LIMIT 1"; $confirmresult=$queryconfirm; now here's the problem I want to add 1 to

Re: [PHP] MYSQL Query question

2004-12-09 Thread Raditha Dissanayake
John Nichel wrote: Raditha Dissanayake wrote: Reinhart Viane wrote: And a last question: I always seem to get stuck on mysql queries when scripting. mysql.com gives me a headache whens earching something. Does someone know a good mysql manual site or a good mysql book? That does not mean mysql q

Re: [PHP] MYSQL Query question

2004-12-09 Thread John Nichel
Raditha Dissanayake wrote: Reinhart Viane wrote: And a last question: I always seem to get stuck on mysql queries when scripting. mysql.com gives me a headache whens earching something. Does someone know a good mysql manual site or a good mysql book? That does not mean mysql questions should be

RE: [PHP] MYSQL Query question

2004-12-09 Thread Reinhart Viane
: [EMAIL PROTECTED] Subject: Re: [PHP] MYSQL Query question >Reinhart Viane wrote: >And a last question: >I always seem to get stuck on mysql queries when scripting. mysql.com >gives me a headache whens earching something. Does someone know a good >mysql manual site or a good mysql bo

Re: [PHP] MYSQL Query question

2004-12-09 Thread Raditha Dissanayake
Reinhart Viane wrote: And a last question: I always seem to get stuck on mysql queries when scripting. mysql.com gives me a headache whens earching something. Does someone know a good mysql manual site or a good mysql book? That does not mean mysql questions should be posted on php mailing lists

[PHP] MYSQL Query question

2004-12-09 Thread Reinhart Viane
Table chat_online: session (varchar) activity (datetime) Table persons persons_region_int(int) Table regions region_id region_name On a page i list all persons which are in the chat_online dbase and within a certain period: $limit_time = time() - 130; // 2 Minutes time out. 60 * 2 = 120 $sql

Re: [PHP] PHP - mySQL query question

2004-07-25 Thread Jason Davidson
single quote 'y' Jason On Sun, 25 Jul 2004 11:05:23 -0400, Karl-Heinz Schulz <[EMAIL PROTECTED]> wrote: > I have a simple question (not for me). > > Why does this query does not work? > > $links_query = mysql_query("select id, inserted, title, information, > international from links WHE

Re: [PHP] PHP - mySQL query question

2004-07-25 Thread John W. Holmes
Karl-Heinz Schulz wrote: I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query("select id, inserted, title, information, international from links WHERE international = y; order by inserted desc LIMIT 0 , 30"); The information for the "internati

[PHP] PHP - mySQL query question

2004-07-25 Thread Karl-Heinz Schulz
I have a simple question (not for me). Why does this query does not work? $links_query = mysql_query("select id, inserted, title, information, international from links WHERE international = y; order by inserted desc LIMIT 0 , 30"); The information for the "international" fields are: Fie

RE: [PHP] Mysql Query Question

2003-03-18 Thread Van Andel, Robbert
Thanks, I knew it was something simple but I couldn't find it on the 'Net. Robbert van Andel -Original Message- From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 1:14 PM To: Van Andel, Robbert; [EMAIL PROTECTED] Subject: Re: [PHP] Mysql Quer

Re: [PHP] Mysql Query Question

2003-03-18 Thread CPT John W. Holmes
$string = "'" . implode("','",$group) . "'"; $query = "SELECT * FROM table WHERE groupname IN ($string)"; ---John Holmes... - Original Message - From: "Van Andel, Robbert" <[EMAIL PROTECTED]> To: <[EMA

[PHP] Mysql Query Question

2003-03-18 Thread Van Andel, Robbert
I am trying to query a database looking for results that match an array of values I have set. The variable array is call group and has about 10 elements. Is there a way that I can query the database using just $group instead of having to use the following: SELECT * FROM `table` WHERE groupname

Re: [PHP] MySQL query question

2002-01-24 Thread Matt
t;[EMAIL PROTECTED]> Subject: [PHP] MySQL query question > Okay, so when I INSERT a row of information into a MySQL database, I > don't want it to place it at the first empty row it findsI want it > to put it after the very last exsisting row. -- PHP General Mailing List (

Re: [PHP] MySQL query question

2002-01-24 Thread Erik Price
If you are using a table with AUTO_INCREMENT set for one of the fields, the default is for MySQL to assign any new row an AUTO_INCREMENT value that is one higher than the currently highest value in that column. In other words, MySQL by default does exactly what you say you are trying to do.

[PHP] MySQL query question

2002-01-24 Thread Phil Schwarzmann
Okay, so when I INSERT a row of information into a MySQL database, I don't want it to place it at the first empty row it findsI want it to put it after the very last exsisting row. One of the fields of the database is an AUTO_INCREMENT type, so Im assuming Im gonna use that in the query. How

Re: [PHP] MySQL Query Question

2001-04-15 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Jeff Holzfaster") wrote: > This works: select date_format(date, "%W, %e %M %Y") as date from table > This doesn't: select concat(date_format(date, "%W, %e %M %Y")," ",time) as > time_of_day > > I'm wondering if it is possible to use concat i

RE: [PHP] MySQL Query Question

2001-04-15 Thread Jeff Holzfaster
> The MySQL manual has a chapter on date/time factions. Or is it > the 'order > by' clause that's giving you trouble...? I assume that 'date' is a > reserved word, so it may be confusing mysql. In which case, try using a > different alias, like 'f_date". This works: select date_format(dat

Re: [PHP] MySQL Query Question

2001-04-15 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Jeff Holzfaster") wrote: > I have a couple questions... first, is there a notable MySQL General List > like this one? Yes. The list on mysql.com is quite active and, like this one, it's common to get responses directly from one of the develo

[PHP] MySQL Query Question

2001-04-15 Thread Jeff Holzfaster
Hi, I have a couple questions... first, is there a notable MySQL General List like this one? Second, how do you write this query properly, or can it be done? select concat(date_format(date, "%W, %e %M %Y")," ",time) as date from TABLE order by date DESC; Thanks! Jeff -- PHP General Mailing