Nathan,
The profiling I included proved that was not the case.
Mysql run the query and return the single column single row result in under
1 second but PHP's mysql-query waited much longer than that to return. If
it was a big result set I could see some slow down in parsing the results
into
David Murphy wrote:
This is from our application
I enabled profile in mysql to determine why an update took 20seconds. As
you can see MySQL reported no where near that amount of duration took
place.
Is there any way I can dig into php and determine why mysql client libs are
so slow
Mark wrote:
I havnt even tried this query but i know its wrong can anyone help!
How do you know it's wrong ? O_o
***
?php
include(header.php);
include(connect.php);
$comp_id = $_SESSION['comp_id'];
$user_id = $_SESSION['user_id'];
// Grab variables and
Craig. Thanks for the response and sorry I've been delayed in getting back
to you.
I put a new page together and dropped all the peripheral code and this is
what I ended up with:
?php
/* MySQL Connection Variables */
$host=localhost;
$user=arras_WebMaster;
$password=qwerty;
{
while($result = mysql_fetch_array($query))
{
echo $result['UserID'];
}
}
HTH,
Michael Egan
-Original Message-
From: Harlequin [mailto:[EMAIL PROTECTED]
Sent: 02 July 2004 09:34
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL QUERY Results Not Appearing[Scanned]
Craig
$result is an array that has to be fetched...try this
echo h3active members should appear here/h3;
$query = mysql_query(SELECT * FROM RegisteredMembers) or die(could not
execute query);
while($result = mysql_fetch_array($query)){
echo $result['YOUR_DB_FIELDNAME'];
}
change
did you also play with group by?
what does this return?
select * from `yourTable` group by `val1`
ciao SVEN
Petre Agenbag wrote:
Hi List
I've been trying to do something with one MySQL query, but I don't
think it is possible, so, I would need to probably do multiple
queries, and possibly
But what's your prob ?
When you say the second one seems to never be executed ...
Does the line:
$row = mysql_fetch_array($result2);
launches a Php Error ?
And pay attention, because you're using mysql_fetch_array and
mysql_fetch_row, be sure that
you are not treating the result in the same way
PROTECTED]
Sent: July 16, 2003 5:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL query problems
But what's your prob ?
When you say the second one seems to never be executed ...
Does the line:
$row = mysql_fetch_array($result2);
launches a Php Error ?
And pay attention, because you're using
If I understand your requirement correctly I would say that you are looking
in the wrong place to protect particular table fields from the user; the
user gets access to the underlying database only through your 'application'
pages (ie. your php pages) - it is your coding of these pages that
function mysql_one_element($query, $element) {
// quickly returns just one element from a query
$one=mysql_query($query);
// add error checking here if you wish
$r=mysql_fetch_array($one);
$thisvalue=$r[$element];
return($thisvalue);
}
$row=mysql_one_element(select euro from
Look into the LIMIT command, it will limit the number of rows in the result
set to the number you specify
-Original Message-
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: mysql query
function mysql_one_element
Ooops, for clarity, I shouldn't have named the result of the function row but
euro. It should be:
$euro=mysql_one_element(select euro from brandstofprijzen where id=2, euro);
Bill wrote:
function mysql_one_element($query, $element) {
// quickly returns just one element from a query
(mysql_error());
$row=mysql_fetch_array($result);
$euro =$row[0];
-Original Message-
From: bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 7:50 AM
To: David Buerer
Subject: Re: [PHP] Re: mysql query
Maybe I wasn't clear. The value returned should be called euro
Jason Whitaker wrote:
OK, I need to know is there a place where i can find out how to pull
information(TEXT) from a MySQL DB table and print where i place a variable
in a php page?
I have NO idea what your question is did you just want to echo something
from your MySQL db table inside a PHP
Let's say you have this table, pseudo-coded:
TABLE table
tableid int auto_increment,
value text
;
You could run this query on it:
insert into table values ('','value');
And the id will be auto generated. Same would apply with:
inert into table (value) values ('value');
Mike
Phil
Try using a LEFT JOIN against the second table, returning only records with
no match.
Something like:
SELECT DISTINCT A.username
FROM user A LEFT JOIN task_assignment B
ON (A.username = B.username)
WHERE B.username IS NULL;
See JOIN syntax in MySQL documentation for more information:
mysql_quory($Query);
typos
i can't also see more errors...
Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Code:
?
$Query = UPDATE feRegUsers SET Constructor='2001-09-17',
Enertec='2001-09-17', Seatec='2001-09-17' WHERE ID LIKE '288';
:) It just started to work. World's a strange place. Maybe someone was doing
something to the server/php/mysql, dunno.
Niklas
-Original Message-
From: _lallous [mailto:[EMAIL PROTECTED]]
Sent: 17. syyskuuta 2001 15:03
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL query error
Nope,
MySql doesn't allow select within select...
try making two seperate queries...
Lizlynch [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
i have two tables here, i want to insert the customername from the Username
table and insert it into the Classification
You cant use a select statement withoug using a table name.
check out this
$query = insert into classification(customername) (select customername from username
where username='$username');
i cant answer ur second question, since i dont the
structure of your table
/sagar
original message
You cant use a select statement withoug using a table name.
check out this
$query = insert into classification(customername) (select customername
from username where username='$username');
Incorrect in mySQL you can do
mysql select 3+5;
returns 8
plus a whole lot of other functions that can
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Niklas lampén) wrote:
Can it cause any problems if mySQL query is very long? I have to compare
many words to many fields in my DB and I've done it like
Field LIKE '%searchword%' || Field LIKE '%searchword%' || Field LIKE
Hi Niklas,
You can use || or OR.
Secondly, huge list of values you say? Can this list be exploded by a
common denominator, like a space or comma? If so, consider this:
$list = // Huge list of words (array), separated by a comma.
$words = explode(,, $list);
$query = SELECT * FROM table WHERE
24 matches
Mail list logo