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
.' tdda da da nbsp;/td /tr'; }// end while ? Edward Dudlik Becoming Digital www.becomingdigital.com - 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

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

2003-06-17 Thread Christopher Lyon
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 pun, as if there's any other kind. ? $query = 'SELECT * FROM table

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 The

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_code

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) )

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: quote 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

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

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

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Evan S. Weiner
= $row[total_billable]; -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SELECT statement problem SELECT * FROM tickets_work WHERE employee_id = '$tech_id' AND start '$start

RE: [PHP-DB] SELECT statement problem

2002-08-15 Thread Miles Thompson
]; $total_billable = $row[total_billable]; -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 2:26 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] SELECT statement problem SELECT * FROM tickets_work WHERE employee_id = '$tech_id' AND start

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]

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).'br'; also, the while loop shouldn't really be necessary as the query should only return one record if I

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 'tabletrthcolumn/ththvalue/th/tr'; while(list($key, $val) = each($row)) { // $row has two key/value pairs per column -- one integer, one

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

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

2002-01-30 Thread Rick Emery
? $db = mysql_connect($dbserver, $dbuser, $dbpass); mysql_select_db($dbname,$db); $sortby = name ASC; $sql=SELECT * FROM webl_players ORDER BY $sortby; $result=mysql_query($sql,$db); print select name=canidate; while( $row = mysql_fetch_array($result) ) { $FirstName = $row['FirstName'];

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. select name=canidate (this can go anywhere but in while loop) ? $db = mysql_connect($dbserver, $dbuser, $dbpass); mysql_select_db($dbname,$db); $sortby = name ASC; $sql=SELECT * FROM webl_players ORDER BY

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 ? $db = mysql_connect($dbserver, $dbuser, $dbpass

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

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