They don't do anything, but my point was, he said that what he pulled
from the DB needed to be put into an array, and I was pointing out, it
already was.
On Wed, 2002-11-27 at 12:23, Mark wrote:
> But what do all those $row['fieldname'} rows do? Call me ignorant
> (you wouldn't be the first), but
But what do all those $row['fieldname'} rows do? Call me ignorant
(you wouldn't be the first), but a statement that simply has a
variable name doesn't DO anything. Should these have echos in front
of them?
--- Adam Voigt <[EMAIL PROTECTED]> wrote:
> Umm, he is putting them into an array, I quote:
Umm, he is putting them into an array, I quote:
while ($row = mysql_fetch_array($result)) {
> > $row['Books.Title'];
> > $row['Books.Author'];
> > $row['Books.ISBN'];
> > $row['BookList.dbase'];
> > $row['BookList.dbase_user'];
> > $row['BoxSet.BoxSe
You need to put your $result into an array. you can use:
$result_array = mysql_fetch_array($result);
then, if you know the field names in the array, print them like so:
echo $result_array["field1"];
echo $result_array["field2"];
or if you dont know their names you can refer to their position nu
On Wednesday 27 November 2002 02:09, The Cossins Fam wrote:
> Hello.
>
> I am using MySQL as a database for a departmental library. I have written
> a quick search script, but keep getting "resource id #2" as a result to my
> search. I have read the online documentation for the
> mysql_fetch_arra
Try this...
either...
while ($row = mysql_fetch_array($result)) {
$title = $row['Books.Title'];
$author = $row['Books.Author'];
...
print $title;
}
or...
while ($row = mysql_fetch_array($result)) {
print $row['Title'];
...
}
-Original Message--
Add: print_r($row)
In your while loop, that will show you everything that is being returned
with both it's numeric and text based position.
On Tue, 2002-11-26 at 13:09, The Cossins Fam wrote:
> Hello.
>
> I am using MySQL as a database for a departmental library. I have written
> a quick search
Thanks a ton, I was really looking right past that variable.
Jas
"Paul Dubois" <[EMAIL PROTECTED]> wrote in message
news:p05111763b92d3addd3b4@[192.168.0.33]...
> At 11:42 -0600 6/12/02, Jas wrote:
> >Not sure how to over come this, the result of a database query keeps
giving
> >me this:
> > >/*
: Jas; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] resource id#2 -
At 11:42 -0600 6/12/02, Jas wrote:
>Not sure how to over come this, the result of a database query keeps
>giving me this: /* Get Ip address, where they came from, and stamp the time */
>if (getenv(HTTP_X_FORWARDED_FOR)){
At 11:42 -0600 6/12/02, Jas wrote:
>Not sure how to over come this, the result of a database query keeps giving
>me this:
>/* Get Ip address, where they came from, and stamp the time */
>if (getenv(HTTP_X_FORWARDED_FOR)){
> $ipaddy = getenv(HTTP_X_FORWARDED_FOR);
>} else {
> $ipaddy = get
The quick answer is that that is what it's supposed to return... that's all
the result is. A nicer, longer answer is to give you some of my code so you
can see one way that you actually get the data out (I use sybase_fetch_row,
but you can also use _fetch_array which returns an associated array
How can I get the form below to list the single record in a db that matches
the request of $user_id?
$table = "auth_users";
$record = @mysql_query("SELECT * FROM $table WHERE user_id =
'$user_id'",$dbh);
while ($row = mysql_fetch_row($record)) {
$user_id = $row['user_id'];
$f_name = $r
On Thursday 30 May 2002 00:41, Jas wrote:
> If you look at the previously posted code at the bottom of the form there
> is a echo for the sql select statement that is echoing "Resource id #2" on
> the page. Now that error is the correct field id number in the database, I
> am just not sure how to
I could be missing something, but it looks like you are using the result of
the mysql_query as the actual result. It actually returns some weird
identifier. To access the real info you'd have to use something like
mysql_fetch_array to get it.
Check out this and see if it helps:
http://www.php.
If you look at the previously posted code at the bottom of the form there is
a echo for the sql select statement that is echoing "Resource id #2" on the
page. Now that error is the correct field id number in the database, I am
just not sure how to itemize the data from that table, at least I thin
On Thursday 30 May 2002 00:17, Jas wrote:
> Ok here is my problem, I set this up so a user selects a name form a select
> box and that name or $user_id is then passed to this page so the user can
> edit the contact info etc. However it does not pull the selected $user_id
> and place each field i
AHAHAHHAHA
AHHAHAHAH
Dan
On Wednesday, January 23, 2002, at 02:19 PM,
[EMAIL PROTECTED] wrote:
> Dan,
>
>> Good, I'm glad it worked!!!
>>
>> I see a lot of people using mysql_fetch_array().
>>
>> Which is fine...But I'm more into Object Oriented programming...and
>> that's why I always
Dan,
> Good, I'm glad it worked!!!
>
> I see a lot of people using mysql_fetch_array().
>
> Which is fine...But I'm more into Object Oriented programming...and
> that's why I always use mysql_fetch_object()
hey this is a family show - but I guess 'what you do in the privacy of' ...
gt;
> J. Wharton
> [EMAIL PROTECTED]
>
> - Original Message -
> From: "Dan Brunner" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 12:21 PM
> Subject: Re: [PHP-DB] Resource Id #2
&g
You have to fetch the row that contains the count in it. Try this:
$resource = mysql_query("SELECT COUNT(*) cnt FROM catalogs WHERE PROCESSED
IS NULL");
$countreq = mysql_fetch_array($resource);
echo $countreq[cnt];
(note as well that if no row is returned by the query then $countreq will be
se
On Thursday 29 November 2001 01:29, Kevin Ruiz wrote:
> I've come across yet another problem.
[snip]
> $ci = "select contactid from users where username='$username' and
> password='$password'";
> $cir = mysql_query($ci)
> or die("Couldn't execute");
> $query
Change code as follows:
".$row['msg']."";
?>
-Original Message-
From: Andrew Duck [mailto:[EMAIL PROTECTED]]
Sent: Sunday, October 28, 2001 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Resource id #2
I am trying to select a message from a table in a database. the message will
will
I am trying to select a message from a table in a database. the message will will be
in column 'msg' and will be
in same row as id='0'.
I need that msg put to the screen. With the code below I get the error: Resource id #2
Can someone please explain how I can fix this..
Thankyou in advance.
$m
23 matches
Mail list logo