RE: [PHP-DB] select statement

2002-10-25 Thread Michael Hazelden
What's the error? -Original Message- From: Steve Dodkins [mailto:Steve.Dodkins@;ebm-ziehl.co.uk] Sent: 25 October 2002 16:46 To: Php-Db (E-mail) Subject: [PHP-DB] select statement Hi I get an error message with the following statement, if I remove the 'AND works_order_part_no=parts_pa

Re: [PHP-DB] SELECT statement

2001-04-04 Thread Ron Brogden
At 03:24 PM 4/4/2001 -0700, Julio Cuz, Jr. wrote: >Every time I run the following code, I get this error if I use a NUMBER >for the 'Email' case: >"Warning: Unable to jump to row 0 on PostgreSQL result index 2 in >/html/rccd/remodel/display2.php on line 35" The problem is that your query is equ

Re: [PHP-DB] SELECT statement

2001-04-04 Thread Julio Cuz, Jr.
Ron, Thanks for your help, but my problem still there even when I made the following changes: $sql = "SELECT * FROM \"Remodel\" WHERE Email=\"".$find."\""; By the way, you're correct when saying that "WO" and "Email" are column names and '"$find" is what the user entered when searching for a

Re: [PHP-DB] SELECT statement

2001-04-05 Thread Jeffrey A Schoolcraft
* Julio Cuz, Jr. ([EMAIL PROTECTED]) wrote: > Ron, > > Thanks for your help, but my problem still there even when I made the > following changes: > > $sql = "SELECT * FROM \"Remodel\" WHERE Email=\"".$find."\""; You don't have to quote the table name either. You can probably get away with som

Re: [PHP-DB] SELECT statement problem

2002-08-15 Thread Miles Thompson
SELECT * FROM tickets_work WHERE employee_id = '$tech_id' AND start > '$start' AND end < '$end' ORDER BY start Which will select everything from tickets_work for a given employee between start and end. What is not working? Miles Thompson At 02:15 PM 8/15/2002 -0400, Evan S. W

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Hutchins, Richard
Can you echo out the sql going in and any errors you're getting when the query doesn't work then post that info to this list? It'll help both you and us diagnose what might be going wrong. In addition, what datatype are the columns named start and end in your database? (Assuming database is MySQL

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Evan S. Weiner
"start"]; $end = $row["end"]; $total_hours = $row["total_hours"]; $total_billable = $row["total_billable"]; -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:26 PM

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Miles Thompson
); > > while ( $row = mysql_fetch_array( $TICKET_WORK_INFO ) ) > { > $ticket_id = $row["ticket_id"]; > $start = $row["start"]; > $end = $row["end"]; > $total_hours = $r

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Miles Thompson
Check the manual for the mysql_fetch_array() function, it shows you how to extract data from $result. You will use the while loop (as shown in the manual's example) to fill your combo box / selct list /drop down menu, whatever we're calling that creature today. Miles At 12:45 PM 1/30/2002 -06

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Rick Emery
"; while( $row = mysql_fetch_array($result) ) { $FirstName = $row['FirstName']; $LastName = $row['LastName']; $id=$row['id']; print "$LastName, $FirstName"; } ?> print ""; -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 12:45 PM To: [E

Re: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread biorn
You will need to put the option tag in a loop to get all of the records in the table. (this can go anywhere but in while loop) "; $i++; } ?> Also, without the value in the option tag, you will not be passing anything to the form. HTH Maureen Biorn Todd Williamsen <[EMAIL PROTECTED]>

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Todd Williamsen
Nope, that doesn't work -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 1:01 PM To: 'Todd Williamsen'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Select statement only returns 1 record "; while( $row = mysql

RE: [PHP-DB] Select statement only returns 1 record

2002-01-30 Thread Rick Emery
27;; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Select statement only returns 1 record Nope, that doesn't work -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 1:01 PM To: 'Todd Williamsen'; [EMAIL PROTECTED] Subject: RE: [P

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Rick Emery
Did you print out the value of $sql before executing it? Was it as you expected? If so, did you print out mysql_num_rows() to verify it's greater than 0? -Original Message- From: Todd Williamsen [mailto:[EMAIL PROTECTED]] Sent: Friday, February 01, 2002 2:52 PM To: [EMAIL PROTECTED] Subj

Re: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread biorn
Is your id an integer or a char/varchar? If it is an integer, take the quotes off $id in your select statement. Todd Williamsen <[EMAIL PROTECTED]> said: > Weird.. > > I want to be able to edit records, which I have done in the past, and I > cannot see why it isn't working... I have tried

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Shrock, Court
I am assuming that this code is NOT the file "do_mod_job.php". What happens if you do this next line right after you execute your query?: echo 'num rows fetched: '.mysql_num_rows($result).''; also, the while loop shouldn't really be necessary as the query should only return one record if I unde

RE: [PHP-DB] SELECT statement does not return rows

2002-02-01 Thread Shrock, Court
oops.forgot a semicolon on the first line of the multi-line code segment > -Original Message- > $row = mysql_fetch_array($result) > echo 'columnvalue'; > while(list($key, $val) = each($row)) { > // $row has two key/value pairs per column -- one integer, > one string > if (is_

RE: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Peter Lovatt
Try this $query = 'SELECT * FROM table $mysql_result = mysql_query($query, $link); while($row = mysql_fetch_array($mysql_result)) { switch ($row["event"] ) { case event_one: $bg = 'blue' break;

Re: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Becoming Digital
om - Original Message - From: "Peter Lovatt" <[EMAIL PROTECTED]> To: "Christopher Lyon" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, 17 June, 2003 17:42 Subject: RE: [PHP-DB] Select Statement with output in different colors. Try this $query =

RE: [PHP-DB] Select Statement with output in different colors.

2003-06-17 Thread Christopher Lyon
t: Tuesday, June 17, 2003 9:51 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] Select Statement with output in different colors. > > Here's a slight alteration to Peter's code in "case" someone isn't > familiar with > switch statements. Ooh, such a bad pu

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Ronan Chilvers
On 13 Jun,2003 at 0:48 G & E Holt wrote: > $resolved=$DB_site->query_first("SELECT * FROM country WHERE > '$resolvingip' BETWEEN ip_from AND ip_to"); Don't think you should have the '' around the ip number. Does that help? Ronan e: [EMAIL PROTECTED] t: 01903 739 997 w: www.thelittledot.com T

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Jason Wong
On Friday 13 June 2003 15:48, G & E Holt wrote: > I hope this is something easy I am overlooking but here goes: > > I have a table called: country which has the following fields: > > FieldType > ip_from double(11,0) > ip_todouble(11,0) > country_cod

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Ronan Chilvers
Here's how I did it when playing with this... Table definition:- CREATE TABLE ip_list ( ip_from double default NULL, ip_to double default NULL, country_code char(2) default NULL, country_name varchar(100) default NULL, KEY ip_from (ip_from,ip_to,country_code,country_name) ) TYPE=MyISAM;

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Doug Thompson
Why not use the built-in conversion functions in mysql? >From the manual: INET_NTOA(expr) Given a numeric network address (4 or 8 byte), returns the dotted-quad representation of the address as a string: mysql> SELECT INET_NTOA(3520061480); -> "209.207.224.40" INET_ATON(expr) Given t