On Fri, Oct 28, 2011 at 18:13, Paul Halliday paul.halli...@gmail.com wrote:
Whats the difference between fetch_assoc and fetch_row?
I use:
while ($row = mysql_fetch_row($theQuery)) {
doCartwheel;
}
on just under 300 million rows and nothing craps out. I have
memory_limit set to 4GB
On Fri, Oct 28, 2011 at 06:19:56PM -0400, Daniel Brown wrote:
On Fri, Oct 28, 2011 at 18:13, Paul Halliday paul.halli...@gmail.com wrote:
Whats the difference between fetch_assoc and fetch_row?
I use:
while ($row = mysql_fetch_row($theQuery)) {
? ?doCartwheel;
}
on just under
On Fri, Oct 28, 2011 at 18:48, Jim Long p...@umpquanet.com wrote:
I'm not seeing any numeric keys in my mysql_fetch_assoc() arrays.
You're absolutely correct, that's my mistake: substitute
mysql_fetch_row() for mysql_fetch_assoc(). Duh.
Time to call it a week
--
/Daniel P. Brown
On 11/3/07, Eduardo Vizcarra [EMAIL PROTECTED] wrote:
Hi guys
After doing some changes, I believe it is partially working, what I did is
the following:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$primer_foto = reset($fotos_mostrar[0]); // This is to set
Eduardo Vizcarra wrote:
Hi guys
After doing some changes, I believe it is partially working, what I did is
the following:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to
the first record
Do you even need reset()? I've never used it.
On Nov 3, 2007 11:08 PM, Jim Lucas [EMAIL PROTECTED] wrote:
Eduardo Vizcarra wrote:
Hi guys
After doing some changes, I believe it is partially working, what I did is
the following:
while($row=mysql_fetch_array($fotos))
{
[EMAIL PROTECTED] wrote:
Do you even need reset()? I've never used it.
Personally, I do not see the need.
The op is building the array then wanting to work with it.
At this point, the internal pointer should still be at the beginning. AFAIK
Jim
--
PHP General Mailing List
Eduardo Vizcarra wrote:
I have a WHILE sentence to retrieve all records from a SELECT query in a
database and am using mysql_fetch_array to store them in a matrix, the
sentence is like this:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$fotos contains all
Hi guys
After doing some changes, I believe it is partially working, what I did is
the following:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to
the first record
echo $primer_foto; // This
I have a WHILE sentence to retrieve all records from a SELECT query in a
database and am using mysql_fetch_array to store them in a matrix, the
sentence is like this:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$fotos contains all records found in a db table, the
this is most peculiar. your code should do exactly what you expect. have
you initialized the $fotos_mostrar array before the while loop?
$fotos_mostrar = array();
Eduardo Vizcarra wrote:
I have a WHILE sentence to retrieve all records from a SELECT query in a
database and am using
Yes, matrix has been defined just before this WHILE sentence
Cristian Vrabie [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
this is most peculiar. your code should do exactly what you expect. have
you initialized the $fotos_mostrar array before the while loop?
$fotos_mostrar
On Friday 02 November 2007 18:23:03 Eduardo Vizcarra wrote:
while($row=mysql_fetch_array($fotos))
{
$fotos_mostrar[] = $row;
}
$fotos contains all records found in a db table, the SELECT statement is
retrieving 2 columns from a table, how do I store all records in a 2
dimention
Hello,
I use the following GetArray for returning an array from mysql results.
But having a hard time modifying it for returning a simple associative array
Like:
$conn-GetAssoc('SELECT id, name from manufacturers')
Array ( [2] = BMW [1] = MAZDA [9] = FORD )
function
On Mon, 2007-07-16 at 07:41 -0700, Andras Kende wrote:
Hello,
I use the following GetArray for returning an array from mysql results.
But having a hard time modifying it for returning a simple associative array
Like:
$conn-GetAssoc('SELECT id, name from manufacturers')
Array ( [2]
On Mon, 2007-07-16 at 10:52 -0400, Robert Cummings wrote:
On Mon, 2007-07-16 at 07:41 -0700, Andras Kende wrote:
Hello,
I use the following GetArray for returning an array from mysql results.
But having a hard time modifying it for returning a simple associative array
Like:
Andras Kende wrote:
Hello,
I use the following GetArray for returning an array from mysql results.
But having a hard time modifying it for returning a simple associative array
Like:
$conn-GetAssoc('SELECT id, name from manufacturers')
Array ( [2] = BMW [1] = MAZDA [9] = FORD )
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, July 16, 2007 7:52 AM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: Re: [PHP] mysql_fetch_array to associative array
On Mon, 2007-07-16 at 07:41 -0700, Andras Kende wrote:
Hello,
I use
On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote:
Hi Rob,
Thanks for your help, its associative but I forget to mention its needs
To be a single dimensional associative array.
$result = array();
while ( $row = mysql_fetch_assoc($get) ) {
$result[] = $row;
}
This creates
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, July 16, 2007 1:46 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: RE: [PHP] mysql_fetch_array to associative array
On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote:
Hi Rob,
Thanks
On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote:
function GetAssoc($query) {
$get = $this-Execute ( $query );
$result = array();
while ( $row = mysql_fetch_array($get) ) {
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, July 16, 2007 6:12 PM
To: Andras Kende
Cc: php-general@lists.php.net
Subject: RE: [PHP] mysql_fetch_array to associative array
On Mon, 2007-07-16 at 13:37 -0700, Andras Kende wrote
--- Anthony Ritter [EMAIL PROTECTED] wrote:
When using mysql_fetch_array() is it necsessary to specify the
second argument - meaning the constant of MYSQL_NUM or
MYSQL_ASSOC?
Whenever you have a question about a function, you can look it up using a
URL formatted as follows:
Thank you Chris.
My question was the call to
mysql_fetch_array()
will also return a result set without the additional argument constant as
in:
while ($row = mysql_fetch_array($sql))
{...
// no constant is being used
There are many times that I see that used in textbooks - without the
--- Anthony Ritter [EMAIL PROTECTED] wrote:
My question was the call to
mysql_fetch_array()
will also return a result set without the additional argument
constant as in:
while ($row = mysql_fetch_array($sql))
{...
// no constant is being used
There are many times that I see that
When using mysql_fetch_array() is it necsessary to specify the second
argument - meaning the constant of MYSQL_NUM or MYSQL_ASSOC?
I have seen many examples where it is left out and it is coded:
$row = mysql_fetch_array($sql);
as opposed to
$row = mysql_fetch_array($sql, MYSQL_BOTH);
Thank
Anthony Ritter wrote:
When using mysql_fetch_array() is it necsessary to specify the second
argument - meaning the constant of MYSQL_NUM or MYSQL_ASSOC?
I have seen many examples where it is left out and it is coded:
$row = mysql_fetch_array($sql);
as opposed to
$row = mysql_fetch_array($sql,
Jeff Ostapchuk wrote:
Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have
like the newest version of MySQL insatlled, and PHP and MySQL work fine
together, excpet when I use mysql_fetch_row($query) then I have problems,
mysql_fetch_array($query) works fine, but not
Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have
like the newest version of MySQL insatlled, and PHP and MySQL work fine
together, excpet when I use mysql_fetch_row($query) then I have problems,
mysql_fetch_array($query) works fine, but not mysql_fetch_row($query).
Hello Jeff,
Thursday, April 15, 2004, 3:18:53 AM, you wrote:
JO Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have
Find out:
?
echo phpinfo();
?
(view it in a browser)
JO like the newest version of MySQL insatlled, and PHP and MySQL work fine
JO together, excpet
I have this query to select the date from my table...
SELECT DATE_FORMAT(date1, '%W %M %Y') FROM table
How do I know what name mysql_fetch_array assigned to the date_format ?
It would be position 0 in the array, or in your query after the date
format function you could put AS blah and then it would come out as
blah.
On Fri, 2004-03-26 at 13:50, Chris Mach wrote:
I have this query to select the date from my table...
SELECT DATE_FORMAT(date1, '%W %M %Y') FROM table
From: Adam Voigt [EMAIL PROTECTED]
On Fri, 2004-03-26 at 13:50, Chris Mach wrote:
I have this query to select the date from my table...
SELECT DATE_FORMAT(date1, '%W %M %Y') FROM table
How do I know what name mysql_fetch_array assigned to the date_format ?
It would be position 0 in
Hi,
Saturday, March 27, 2004, 4:50:27 AM, you wrote:
CM I have this query to select the date from my table...
CM SELECT DATE_FORMAT(date1, '%W %M %Y') FROM table
CM How do I know what name mysql_fetch_array assigned to the date_format ?
SELECT DATE_FORMAT(date1, '%W %M %Y') AS date_formatted
Hey peeps.
Let me make this simple. I've got the following sql query in a function:
SELECT c.id
, cc.id
, cc.prod_id
, p.name
, cc.price
, cc.qty
FROM cart AS c
INNER JOIN cart_contents AS cc
ON cc.cart_id = c.id
INNER JOIN products AS p
Chris W. Parker wrote:
Hey peeps.
Let me make this simple. I've got the following sql query in a function:
SELECT c.id
, cc.id
, cc.prod_id
, p.name
, cc.price
, cc.qty
FROM cart AS c
INNER JOIN cart_contents AS cc
ON cc.cart_id = c.id
Marek Kilimajer mailto:[EMAIL PROTECTED]
on Tuesday, October 07, 2003 12:26 PM said:
(c.id) You can make the query:
SELECT c.id
, cc.id AS ccid
, cc.prod_id
, p.name
doh! how obvious!
thanks.
c.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
I'm trying to make a PHP script that automaticly makes a link on the side
menu to the id page that was just made, under certain catagories. But I
edited my code to cleen up soem errors and all of a sudden 3 errors came up,
and I haven't been able to fix them! They are:
Warning:
It has to do with you assuming everything will work 100%
of the time. It won't. mysql_query() returns false on
failure, check for that. Read this recent thread:
http://marc.theaimsgroup.com/?l=php-generalm=105517588819420
Also, this faq explains it:
hi everyone! i'm new here (and new to php) and have a question. i'm trying
to run a simple blogger type script but am running into a problem i can't
seem to troubleshoot. first, the three items i put into the database aren't
showing up on my page and then when i try to go to the archive for
A key to understanding your mysql errors is by using
the mysql_error() function. It's wonderful! Here's
a simple example with a little error checking:
?php
error_reporting(E_ALL);
$conn = mysql_connect('host','user','pass');
if (!$conn) {
print Could not connect to mysql : .
I am trying to clone my webserver because I am switching ISPs. So I copied
the MySQL database, and then I copied the php pages. But my new server
insists that any query I do is not a valid result resource when I try to use
it in a mysql_fetch_array command. I know that both php and the
At 9:38 PM -0400 19/5/02, Justin Latham wrote:
insists that any query I do is not a valid result resource when I try to use
it in a mysql_fetch_array command. I know that both php and the database
So what errors are being returned by all the mysql_* calls?
Error messages are their to help the
Hi All,
I am new to PHP and am having a bit of trouble. I have a recordset using...
$events = mysql_fetch_array($recordset);
this drags in 3 columns from my table...
event_id, event_title, event_date
I want to search the recordset for a given date, if found I want to be able
to reference
$db = mysql_open();
$results = mysql_query( select * from something, $db );
while( $row = mysql_fetch_array( $results ) ) {
processing using $row[column] as reference
}
Ben
At 11:21 05/04/2002, Phil Ewington wrote:
Hi All,
I am new to PHP and am having a bit of trouble. I have a
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mysql_fetch_array()
On Friday 05 April 2002 18:21, you wrote:
Hi All,
I am new to PHP and am having a bit of trouble. I have a
recordset using...
$events = mysql_fetch_array($recordset);
this drags in 3 columns from my table...
event_id
At 05.04.2002 12:31, you wrote:
Jason,
This is for an events calendar, I want all the dates form the db but when I
am generating the individual days for the calendar I need to know whether
there is an event for that day, hence pulling out all the dates from the db.
As I am looping through all
On Fri, 5 Apr 2002, Phil Ewington wrote:
This is for an events calendar, I want all the dates form the db but when I
am generating the individual days for the calendar I need to know whether
there is an event for that day, hence pulling out all the dates from the db.
As I am looping through
you can also do
$queryString = select table1.uid as 'my_uid' , table2.uid as 'their_uid'
from table1, table2
where ... ;
Greg Sidelinger wrote:
Subject:
[PHP] mysql_fetch_array
From:
Greg Sidelinger
Ok I have use mysql_fetch_array to dump the results of a select query with a
join in it.
if my tables contain a column with the same name how can I distinguish from
them. I'm used to
table_name.value method in other languages but when I tried
$row['table_name.value'] I don't get any values.
can
If everything else fails, you should consider using mysql_fetch_row() instead.
Bogdan
Greg Sidelinger wrote:
Ok I have use mysql_fetch_array to dump the results of a select query with a
join in it.
if my tables contain a column with the same name how can I distinguish from
them.
--
PHP
Hi,
In your SQL, you can say
select t1.col colt1, t2.col colt2
from table1 t1, table2 t2
where t1.something = t2.samething
In other words, you can name your columns differently in your select clause.
I
Bogdan Stancescu [EMAIL PROTECTED] wrote: If everything else fails, you should consider
echo a href='$PHP_SELF?offset=$i*$step' target='_top'
Missing end quote and semicolon on this line may be the reason...
Try properly indenting and formatting your code. Also take advantage of
going in and out of php mode to seperate your code from your display of
content...
Ex:
instead of
- Original Message -
From: Web user [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 27, 2001 10:18 AM
Subject: [PHP] mysql_fetch_array() doesn't work
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
When PHP is running at the line: $arr=mysql_fetch_array
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
hi. this doesn't have to do with mysql_fetch_array. the following will
create that error :
echo a $b['c'] d e f;
the following will not :
echo a $b[c] d e {$f['g']} h i $j[$k] l 'm' n o p;
adjust accordingly. just posted a few words on this topic recently, can
view them here :
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
?
..
..
$res=mysql_query($query);
$num=mysql_num_rows($res);
for($i=0; $i$num; $i++){
$arr=mysql_fetch_array($res);
...
}
...
When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as
Can someone tell me what i'm doing wrong here?
?php
//Connect to db
$db = mysql_pconnect(localhost,login,pass);
mysql_select_db(database,$db);
//Check for the IP
$result2 = mysql_query(SELECT ip FROM ip where ip = '$REMOTE_ADDR',$db);
while($myrowmysql_fetch_array($result2))
{
echo Print
On Thu, 6 Sep 2001 18:09, [EMAIL PROTECTED] wrote:
Can someone tell me what i'm doing wrong here?
?php
//Connect to db
$db = mysql_pconnect(localhost,login,pass);
mysql_select_db(database,$db);
//Check for the IP
$result2 = mysql_query(SELECT ip FROM ip where ip =
PROTECTED]
Sent: Thursday, September 06, 2001 2:09 PM
Subject: [PHP] mysql_fetch_array
Can someone tell me what i'm doing wrong here?
?php
file://Connect to db
$db = mysql_pconnect(localhost,login,pass);
mysql_select_db(database,$db);
file://Check for the IP
$result2 = mysql_query(SELECT ip FROM ip
Hello All,
Another question.
Here is the problem:
- One SQL query
- 1 result.
I have a form that has more than one drop down lists. I
like to use the mysql_fetch_array($result) to populate the
select options.
The problem is that after the first use, the
mysql_fetch_array($result) does not
Greetings!
I am using PHP and MySQL in RedHat 6.0.
I have used mysql_fetch_array() to display the datas in web page but all the
columns are printed twice. What can be the wrong with my code:
?php
$connection=mysql_connection(...);
$db=mysql_select_db(.);
you needed to call
mysql_query. In your code, $mysql_query isn't a variable, it's a function
in PHP.
-Original Message-
From: Deependra B. Tandukar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 07, 2001 9:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mysql_fetch_array()
Greetings!
I am using P
On Thu, 8 Mar 2001 14:03, Deependra B. Tandukar wrote:
Greetings!
I am using PHP and MySQL in RedHat 6.0.
I have used mysql_fetch_array() to display the datas in web page but
all the columns are printed twice. What can be the wrong with my code:
?php
Have I lost something somewhere?
I have code which runs under PHP3.0.15, and PHP4.0.2 which references the
result of a
$row = mysql_fetch_array($result_of_query);
by doing things like:
$row["this_is_a_field_name"]
Seems simple, right?
Well - I compiled a new copy of Apache
I'd be curious to see others' answers on this because I upgraded everything
the other day (been at php4 for a while though) and I don't have a problem
with the quotes.
On 2/12/01 11:11 PM this was written:
Have I lost something somewhere?
I have code which runs under PHP3.0.15, and PHP4.0.2
"Scott Brown" [EMAIL PROTECTED] wrote:
I have code which runs under PHP3.0.15, and PHP4.0.2 which references the
result of a
$row["this_is_a_field_name"]
Well - I compiled a new copy of Apache 1.3.17, pushed PHP up to 4.0.4pl1,
and upgraded mysql to the new stable version at the same
"Scott Brown" [EMAIL PROTECTED] wrote:
$row["this_is_a_field_name"]
Seems simple, right?
Well - I compiled a new copy of Apache 1.3.17, pushed PHP up to 4.0.4pl1,
and upgraded mysql to the new stable version at the same time...
Now the above code doesnt work. But if I do a:
Forgot to
Forgot to ask - does referencing an array with double quotes
around the key work for arrays not associated with a MySQL
result? I doubt it's specific to MySQL result arrays, but
it doesn't hurt to check. Make a small array and test.
I grabbed an example of of php.net dealing with just
I'd be curious to see others' answers on this because I
upgraded everything
the other day (been at php4 for a while though) and I don't
have a problem
with the quotes.
I've probably just putzed something somewhere during the build it's
been one of those days.
But the thing is it's
Because, basically, in php an array is a hash with just numbers
as keys.
m.
--
Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/
EMail: [EMAIL PROTECTED]
PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc
PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5
Hi,
I'm trying to echo out the field names used as key values in a
mysql_fetch_array:
$link_id = mysql_connect("localhost", "root", $pass);
mysql_select_db("database", $link_id);
$result = mysql_query("select * from lists where id = 1", $link_id);
$rowData = mysql_fetch_array($result);
.
-Anonymous
- Original Message -
From: "Jaxon" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 21, 2001 8:07 PM
Subject: [PHP] mysql_fetch_array strangeness
Hi,
I'm trying to echo out the field names used as key values in a
mysql_f
73 matches
Mail list logo