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;
.'
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
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
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
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
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)
)
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
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
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
= $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
];
$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
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]
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
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
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
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
?
$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'];
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
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
* 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
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
21 matches
Mail list logo