o: "Beauford.2003" <[EMAIL PROTECTED]>
Sent: Tuesday, December 03, 2002 7:41 PM
Subject: Re: Select, mysql_fetch_array, PHP question
> Maybe you have an "if ($line = mysql_fetch_array($result))" line
> somewhere up above? That would cause the while loop to skip
re are three of them, the query works and displays the information, but
if there is only one item the query works but doesn't display the item. I
just get a blank page.
SELECT price, item FROM list WHERE price="$5.00";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
ec
On Tue, 3 Dec 2002 08:38:59 -0500, Beauford.2003 wrote:
> while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
> echo $item; }
Try echo $line['item'];
- Steve Yates
- Any sufficiently advanced magic looks like technology.
~ Taglines by Taglinator -
$item is probably undefined, unless you are assigning it a value somewhere
else in your script. mysql_fetch_array is putting the result set in an
associative array called $line, so $line['item'] would hold the result from
your query.
-Original Message-
From: Beauford.2003 [mai
isplay the item. I
just get a blank page.
SELECT price, item FROM list WHERE price="$5.00";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo $item; }
If I do the same search from the MySQL command line the query will display
one or more
e PHP docs at http://php.net/mysql_fetch_array for a hint,
and then the entire docs again so you know what you're doing.
--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock
-
Before posting, ple
On Sat, 2002-11-09 at 23:53, Chip Shabazian wrote:
> ok, here is my code without all of the html (sorry people). I'm trying
> to get a sum of the field runtime. With this code, I get "Resource id
> #3" as an error. Any help getting me to the proper result would be
> greatly appreciated.
>
> @$
ok, here is my code without all of the html (sorry people). I'm trying
to get a sum of the field runtime. With this code, I get "Resource id
#3" as an error. Any help getting me to the proper result would be
greatly appreciated.
".$dvd_time_result."";
?>
Thanks,
Chip
$dvd_time_query = "select sum(runtime) from list";
$dvd_time_result = mysql_query($dvd_time_query);
#$dvd_time_display = mysql_fetch_array($dvd_time_query);
#echo "".($dvd_time_display[count])."";
echo "".$dvd_time_result."";
Notice I've tried a
urage/9.0.2509
>>> Date: Thu, 07 Mar 2002 18:20:31 +0200
>>> Subject: Stepping through a MySQL_fetch_array in PHP?
>>> From: Gavin Philips-Page <[EMAIL PROTECTED]>
>>> To: MySQL Problems <[EMAIL PROTECTED]>
>>>
>>> Could anybody plea
ECTED]) wrote:
> User-Agent: Microsoft-Entourage/9.0.2509
> Date: Thu, 07 Mar 2002 18:20:31 +0200
> Subject: Stepping through a MySQL_fetch_array in PHP?
> From: Gavin Philips-Page <[EMAIL PROTECTED]>
> To: MySQL Problems <[EMAIL PROTECTED]>
>
> Could anybody please hel
$sql="select * from table where blah=$blah";
$x=mysql_query($sql);
while ($data=mysql_fetch_array($x)) {
echo "$data[columnName]";
}
I think is what your trying to do...
On Thu, 7 Mar 2002, Gavin Philips-Page wrote:
|Could anybody please help:
|
= mysql_fetch_array($result). Is it possible to create a loop
with a counter to step through the records contained in the array?
// PHP Code
$link_id = db_connect($default_dbname) ;
if(!$link_id) error_message(sql_error()) ;
$query = "select count(*) from $user_tablename" ;
$result = m
$base,$db);
> ?>
>$result = mysql_query("select nombres,email from usuarios");
+ echo mysql_error();
> while ($row = mysql_fetch_array($result)) {
> echo "user_id: ".$row["nombres"]."\n";
> echo "user_id: &
PROTECTED]>
Sent: Tuesday, February 12, 2002 1:28 AM
Subject: Re: mysql_fetch_array
>
> On Mon, 11 Feb 2002, [AFQ]T1T4N wrote:
>
> > dear friends..
> >
> > i'm doing a simple script that use mysql_fetch_array() and it give me
the
> > following error.
> >
On Mon, 11 Feb 2002, [AFQ]T1T4N wrote:
> dear friends..
>
> i'm doing a simple script that use mysql_fetch_array() and it give me the
> following error.
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /apache/htdocs/html/intranet.do
dear friends..
i'm doing a simple script that use mysql_fetch_array() and it give me the
following error.
Warning: Supplied argument is not a valid MySQL result resource in
/apache/htdocs/html/intranet.domus.cl/base.php on line 10
Warning: Supplied argument is not a valid MySQL r
You're missing the semi-colon after the ($query) on the previous line
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 22, 2002 10:26 AM
Cc: [EMAIL PROTECTED]
Subject: mysql_fetch_array
i'm checking a php that has the following thin
while ($line = mysql_fetch_array($result1)
{
execute your code
}
Curtis
Original Message
From: [EMAIL PROTECTED]
Date: Tue 1/22/02 11:40
To: Undisclosed Recipients
Cc: [EMAIL PROTECTED]
Subject:mysql_fetch_array
i
i'm checking a php that has the following thing
$result1= mysql_query($query)
$line = mysql_fetch_array($result1);
and it give me the following error
Warning: Supplied argument is not a valid MySQL result resource in
/apache/htdocs/html/intranet.domus.cl/mail.php on line 242
where the
20 matches
Mail list logo