Sounds like you need a join. Maybe something like:
select * from chat c1,
chat_online c2
where
UNIX_TIMESTAMP(c2.activity)=$limit_time and
c2.session_id = $thisuser and
((c1.user1_sessionid = $thisuser) or
c1.user2_sessionid = $thisuser));
Hi,
I have a query to mysql basically saying:
$query = select * from table1 where colum1 like '$email%';
//where $email is defined string.
When i echo $query, I get the string : select * from table 1
where colum1 like 'testdata%'
If i copy paste the string into phpMyAdmin SQL, the
[snip]
$query = select * from table1 where colum1 like '$email%';
$returnValue = QueryDatabase($query);
echo mysql_num_rows($returnValue);
I always get 0 for the # of records.
[/snip]
You have not included the code from your QueryDatabase
* Thus wrote Victor C.:
If i copy paste the string into phpMyAdmin SQL, the query executes
successfully and returns one record.
However, when I just do$returnValue = QueryDatabase($query);
echo
I have a database with a date field in this format
20041016
I'd like to count how many records were made on each day (except today)
and average them. Can I do this in one query or will I need to do some
more PHP stuff after I get some results? Thanks.
Bare bones so far:
$sql = select date1 from
[mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 2:35 PM
To: PHP
Subject: [PHP] MySQL query for average records per day
I have a database with a date field in this format
20041016
I'd like to count how many records were made on each day
(except today)
and average them. Can I
From: Jeff Oien [EMAIL PROTECTED]
I have a database with a date field in this format
20041016
I'd like to count how many records were made on each day (except today)
and average them. Can I do this in one query or will I need to do some
more PHP stuff after I get some results? Thanks.
Bare
[snip]
I have a database with a date field in this format
20041016
I'd like to count how many records were made on each day (except today)
and average them. Can I do this in one query or will I need to do some
more PHP stuff after I get some results? Thanks.
Bare bones so far:
$sql = select
On Thu, 16 Sep 2004 15:15:01 -0400, John Holmes
[EMAIL PROTECTED] wrote:
You can't get the average and a count in the same query
Sure you can.
desc numbers;
++-+--+-+-+---+
| Field | Type| Null | Key | Default | Extra |
[snip]
You can't get the average and a count in the same query
Sure you can.
mysql select count(number), avg(number) from numbers;
+---+-+
| count(number) | avg(number) |
+---+-+
|18 | 2.3889 |
+---+-+
1
From: Greg Donald [EMAIL PROTECTED]
You can't get the average and a count in the same query
Sure you can.
mysql select count(number), avg(number) from numbers;
Depends how you interpret his request, I guess. I took it as a request for
the count of records per day and then the average of those
On Thu, 16 Sep 2004 16:08:45 -0400, John Holmes
[EMAIL PROTECTED] wrote:
Depends how you interpret his request, I guess. I took it as a request for
the count of records per day and then the average of those counts.
So, if you had
D1
D1
D1
D1
D2
D2
D3
The count would be
D1 - 4
John Holmes wrote:
From: Greg Donald [EMAIL PROTECTED]
You can't get the average and a count in the same query
Sure you can.
mysql select count(number), avg(number) from numbers;
Depends how you interpret his request, I guess. I took it as a request
for the count of records per day and then the
From: Greg Donald [EMAIL PROTECTED]
mysql select the_date, count(number), avg(number) from dates group by
the_date;
++---+-+
| the_date | count(number) | avg(number) |
++---+-+
| 2004-01-01 | 3 | 2. |
|
[snip]
mysql desc dates;
+--+-+--+-+-+---+
| Field| Type| Null | Key | Default | Extra |
+--+-+--+-+-+---+
| the_date | date| YES | | NULL| |
| number | int(11) | | | 0 | |
I have a simple question (not for me).
Why does this query does not work?
$links_query = mysql_query(select id, inserted, title, information,
international from links WHERE international = y; order by inserted desc
LIMIT 0 , 30);
The information for the international fields are:
Field:
Karl-Heinz Schulz wrote:
I have a simple question (not for me).
Why does this query does not work?
$links_query = mysql_query(select id, inserted, title, information,
international from links WHERE international = y; order by inserted desc
LIMIT 0 , 30);
The information for the
single quote 'y'
Jason
On Sun, 25 Jul 2004 11:05:23 -0400, Karl-Heinz Schulz
[EMAIL PROTECTED] wrote:
I have a simple question (not for me).
Why does this query does not work?
$links_query = mysql_query(select id, inserted, title, information,
international from links WHERE
]
Subject: [PHP] MySQL QUERY Results Not Appearing[Scanned]
Hi all...
Despite being able to make a connection to the server and execute a query I
am unable to do this through PHP using the following commands:
echo h3active members should appear here/h3;
$query = SELECT * FROM RegisteredMembers
Glad to be of help. I'm sure there will be many more occasions when I'm badly in need
of assistance.
Cheers,
Michael
-Original Message-
From: Harlequin [mailto:[EMAIL PROTECTED]
Sent: 02 July 2004 13:55
To: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL QUERY Results Not Appearing[Scanned
Hi all...
Despite being able to make a connection to the server and execute a query I
am unable to do this through PHP using the following commands:
echo h3active members should appear here/h3;
$query = SELECT * FROM RegisteredMembers;
$result = mysql_query($query) or die (could not execute
2004 12:42
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL QUERY Results Not Appearing[Scanned]
Hi all...
Despite being able to make a connection to the server and execute a query I
am unable to do this through PHP using the following commands:
echo h3active members should appear here/h3;
$query
the mysql_num_rows() function and it
will return the number of total rows rather than just $limit.
cheers,
Alessandro
-Messaggio originale-
Da: Matt Matijevich [mailto:[EMAIL PROTECTED]
Inviato: giovedi 24 giugno 2004 21.41
A: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Oggetto: Re: [PHP] MYSQL
No other way. Use one query to count the total record and then another
query for limiting
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi. I want to query some data in MYSQL and show the results in page order in
some fashion (ORDER BY ...)
I've been using the LIMIT sentence like this
LIMIT offset, max_per_page
so if max_per_page = 5 then the first time the sentence will be LIMIT 0,
5, in page 2 LIMIT 5,5 and so no.
My
[snip]
Is this right? Is there other efficent way to do it?
What about if data changes (i.e. new records are added) while the user
browses through pages?
[/snip]
on each page do a:
SELECT count(*) FROM table WHERE your_condition
this will give you your total number of results
--
PHP General
Hi,
I just can't find the forum for any mysql. anyways maybe someone run into
this kind of problem,
i'm saving in a db records of company and in a column i have numbers i.e
1,2,12,31,32
so if want to search a company that has number 2
i do category REGEXP '2'
but the problem it will return
[snip]
I just can't find the forum for any mysql.
[/snip]
http://www.mysql.com/doc/en/Mailing-list.html
[snip]
anyways maybe someone run into this kind of problem, i'm saving in a db
records of company and in a column i have numbers i.e 1,2,12,31,32 so
if want to search a company that has
or just read the manual at mysql.com ..
Jay Blanchard [EMAIL PROTECTED] wrote:
[snip]
I just can't find the forum for any mysql.
[/snip]
http://www.mysql.com/doc/en/Mailing-list.html
[snip]
anyways maybe someone run into this kind of problem, i'm saving in a db
records of company
[snip]
or just read the manual at mysql.com ..
[/snip]
Top posting.
What's annoying?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have the following query.
UPDATE link SET hits = hits+1 WHERE website_link = '$link'
$link is the website link that was clicked on.
The query works fine. The problem is if $link is a website that does
not exist in the database mysql_query(); still returns true even though
nothing was
Jason Giangrande wrote:
UPDATE link SET hits = hits+1 WHERE website_link = '$link'
$link is the website link that was clicked on.
The query works fine. The problem is if $link is a website that does
not exist in the database mysql_query(); still returns true even though
nothing was updated.
On Wednesday 28 January 2004 12:05, Jason Giangrande wrote:
I have the following query.
UPDATE link SET hits = hits+1 WHERE website_link = '$link'
$link is the website link that was clicked on.
The query works fine. The problem is if $link is a website that does
not exist in the database
I need to query for record within a certain date stamp. The
datetime field contains the createdon information that i need and is in
the following format: 2004-01-11 21:40:50
What I'd like to do is search for records that are between
2004-01-09 and 2004-01-04. The time is to be
Hello Ashley,
Monday, January 12, 2004, 8:21:01 PM, you wrote:
AMK What I'd like to do is search for records that are between
AMK 2004-01-09 and 2004-01-04. The time is to be ignored, just the date is
AMK what I need to search by. Is there a way to do this within an sql
AMK query, or do I
RD SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD 00:00:00' AND '2004-01-04 23:59:59'
Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might actually
be able to not even include the seconds, try
From: Ashley M. Kirchner [EMAIL PROTECTED]
I need to query for record within a certain date stamp. The
datetime field contains the createdon information that i need and is in
the following format: 2004-01-11 21:40:50
What I'd like to do is search for records that are between
From: Richard Davey [EMAIL PROTECTED]
RD SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD 00:00:00' AND '2004-01-04 23:59:59'
Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might actually
Richard Davey wrote:
RD SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD 00:00:00' AND '2004-01-04 23:59:59'
Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might actually
be able to not even
From: Ashley M. Kirchner [EMAIL PROTECTED]
RD SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD 00:00:00' AND '2004-01-04 23:59:59'
Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might
Hello Ashley,
Monday, January 12, 2004, 8:43:07 PM, you wrote:
AMK Assume I don't know what those dates are. I need to search based on
AMK whatever the current date is, and search between 2 and 7 days back. The
AMK dates in my previous post were simply an example.
Somewhat important
ok im stumped lol i have used this code in the past to insert data into
mysql (im relitively new though)
--code
mysql_query(INSERT INTO Images (Image, desc) VALUES ('$name',
'$description')) or die (mysql_error());
--end code-
but i get this error]
-error-
Hi,
Friday, October 3, 2003, 8:17:23 PM, you wrote:
CM ok im stumped lol i have used this code in the past to insert data into
CM mysql (im relitively new though)
CM --code
CM mysql_query(INSERT INTO Images (Image, desc) VALUES ('$name',
CM '$description')) or die (mysql_error());
CM
Thanx Tom, i should of realized that lol.
Again Thanx :)
Tom Rogers [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
Friday, October 3, 2003, 8:17:23 PM, you wrote:
CM ok im stumped lol i have used this code in the past to insert data
into
CM mysql (im relitively new though)
CM
DESC is a reserved word (used to indicate a DESCending ORDER bY).
N
On Friday 03 Oct 2003 11:17 am, Cameron Metzke wrote:
ok im stumped lol i have used this code in the past to insert data into
mysql (im relitively new though)
--code
mysql_query(INSERT INTO Images (Image, desc)
Hello everyone!
I'm trying to get the total number of a certain records from a database,
but the result is always '1'. Please advise!
=MySql Table =
=activitiy =
id | employee_id | project_id | date
1 | 45 | 60 | 2003-09-09
2 | 34 | 10 | 2003-09-10
3
I'm trying to get the total number of a certain records from a database,
but the result is always '1'. Please advise!
=MySql Table =
=activitiy =
id | employee_id | project_id | date
1 | 45 | 60 | 2003-09-09
2 | 34 | 10 | 2003-09-10
3 | 45 | 45
I'm used to do like this:
$query = 'SELECT * FROM cities';
$result = mysql_query($query);
if($row = mysql_fetch_array($result))
do {
echo ('tr td class=city' . $row[0] . ', ' . $row[1] . '/td
td' . $row[2] . '/td td' . $row[3] . /td /tr\n);
} while ($row = mysql_fetch_array($result));
This is not true, the resource link identifier is optional! If unspecified,
the last opened link is used. My suggestion is to check the results of
mysql_error() for more information on the failed query.
HTH,
Ivo
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
$dbh
[snip]
This is not true, the resource link identifier is optional! If
unspecified,
the last opened link is used. My suggestion is to check the results of
mysql_error() for more information on the failed query.
[/snip]
You are right, of course...my sleepy brain just glanced at the code and
fired
* Thus wrote Steven Kallstrom ([EMAIL PROTECTED]):
Hello all...
I'm embarrassed by this one... I think it should work but it isn't...
$query = 'SELECT * FROM cities';
$result = mysql_query($query);
while ($row = mysql_fetch_row($result)) {
getting this error:
Try this,
$result = mysql_query($query,$dbh);
-Murugesan
- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: Steven Kallstrom [EMAIL PROTECTED]; PHP List
[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 4:50 PM
Subject: RE: [PHP] PHP - MySQL Query...
[snip]
$dbh
Hello all...
I'm embarrassed by this one... I think it should work but it isn't...
$dbh = mysql_connect(localhost, login, password) or
die('cannot connect to the database because: ' . mysql_error());
mysql_select_db(database);
$query = 'SELECT * FROM cities';
$result =
Steven Kallstrom wrote:
Hello all...
I'm embarrassed by this one... I think it should work but it isn't...
$dbh = mysql_connect(localhost, login, password) or
die('cannot connect to the database because: ' . mysql_error());
mysql_select_db(database);
$query = 'SELECT * FROM cities';
[snip]
$dbh = mysql_connect(localhost, login, password) or
die('cannot connect to the database because: ' . mysql_error());
mysql_select_db(database);
$query = 'SELECT * FROM cities';
$result = mysql_query($query);
while ($row = mysql_fetch_row($result)) {
echo ('tr td
I think this does what you want. You can probably extend it to do the final
check for val3 vs. val2
select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as t2
where t1.val2 = t2.val2 group by t1.val1;
HTH
On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote:
Hi List
On further reflection, my first attempt works for the specific example but may
not in the general case. Try using a combination of max( ...id ) and min(
...val2 ) and add t1.val2 to the group by clause. This might work, but I've
deleted my test files now!
On Friday 01 Aug 2003 7:04 am,
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 have queries inside loops, but I am rather weary of that so,
I'd like your views/possible solutions to doing the following:
Consider
Hi List
OK, I've posted this on the MySQL list as well, but it seems a bit quiet
there, and arguably it could definately be a PHP rather than mysql question
depending on whether it can be done with one query (then it was/is a mysql
query), or whether it should be done with some structures and
select * from main
left join fof on main.id = fof.id
left join pub on main.id = pub.id
left join gov on main.id = gov.id
left join med on main.id = med.id
left join ngo on main.id = ngo.id
left join own on
Don't know whether it's just because it's late at night here in the UK or
whether I'm being a bit dim, but wouldn't it be much, much easier to store
all the data in your non-main tables in a single table and distinguish the
type of data (i.e. fof, pub, gov, etc) by a field. This would
-
From: Petre Agenbag [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 2:13 PM
Subject: [PHP] MySQL query/PHP logic?
Hi List
OK, I've posted this on the MySQL list as well, but it seems a bit quiet
there, and arguably it could definately be a PHP rather than mysql
Hi,
Not sure if the problem here is PHP or MySQL, but here we go. I am
trying to do two queries on a database - one after the other, but the
second one never seems to get executed. The two queries are identical
except for two variables. I have checked my form and they are correct
and are being
Change $email_error to $mysqlerror and hopefully some error message will
appear.
Beauford.2005 wrote:
if ($mysqlerror) {
$error = $d_base_error$email_error;
include(trades-input.php);
exit;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
[mailto:[EMAIL PROTECTED]
Sent: July 16, 2003 1:18 PM
To: Beauford.2005
Cc: PHP
Subject: Re: [PHP] MySQL query problems
Change $email_error to $mysqlerror and hopefully some error message will
appear.
Beauford.2005 wrote:
if ($mysqlerror) {
$error
Hello ,
Can someone tell me what is wrong with the following querys ? I am
pretty sure its got something to do with the quotes around $_POST[]
variables.
$sql1 = SELECT * from `admin` where `admin`.user =
'$_POST['validuser']' AND `admin`.pwd = '$_POST['password']';
$sql1 = SELECT * from
[snip]
$sql1 = SELECT * from `admin` where `admin`.user =
'$_POST['validuser']' AND `admin`.pwd = '$_POST['password']';
$sql1 = SELECT * from `admin` where user = $_POST['validuser'] AND
pwd = $_POST['pass'];
[/snip]
subtle differences
$sql1 = SELECT * from `admin` where `admin`.user =
-Original Message-
From: Pushpinder Singh Garcha [mailto:[EMAIL PROTECTED]
Sent: 30 June 2003 19:10
Can someone tell me what is wrong with the following querys ? I am
pretty sure its got something to do with the quotes around $_POST[]
variables.
$sql1 = SELECT * from `admin`
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi
Am Montag, 30. Juni 2003 20:10 schrieb Pushpinder Singh Garcha:
Hello ,
Can someone tell me what is wrong with the following querys ? I am
pretty sure its got something to do with the quotes around $_POST[]
variables.
$sql1 = SELECT * from
Thanks to all you great ppl out there !!!
have a great weekend ;-) for those in north america
FYI : mine has just started !
cheers
--Pushpinder
On Monday, June 30, 2003, at 02:36 PM, Thorsten Körner wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi
Am Montag, 30. Juni 2003 20:10
Hi,
i want to make a mySQL query where the result should be
in $result1
any sting with a phrase of $search
in $result2
any sting with the exact phrase of $search
$result1 works fine, but $result2 gives out an empty sting
$result1 = mysql_query(SELECT name FROM table WHERE name LIKE
= does not take the wildcard (%).
-Original Message-
From: Harry.de [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] mySQL query - command LIKE OR =
Hi,
i want to make a mySQL query where the result should be
in $result1
any sting
I am trying to query a database looking for results that match an array of values I
have set.
The variable array is call group and has about 10 elements. Is there a way that I can
query the database using just $group instead of having to use the following:
SELECT * FROM `table` WHERE
$string = ' . implode(',',$group) . ';
$query = SELECT * FROM table WHERE groupname IN ($string);
---John Holmes...
- Original Message -
From: Van Andel, Robbert [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 3:51 PM
Subject: [PHP] Mysql Query Question
I am
Thanks, I knew it was something simple but I couldn't find it on the 'Net.
Robbert van Andel
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 1:14 PM
To: Van Andel, Robbert; [EMAIL PROTECTED]
Subject: Re: [PHP] Mysql Query Question
Is there a way of updating a table so that I can add some sort of
identifier
to each field, something as simple as x=1 will do. I want to be able
to
modify the table so I can set a variable for each column so I can tell
whether I can let a user modify that field. If I modify the fieldname
Hi,
Is there a way of updating a table so that I can add some sort of identifier
to each field, something as simple as x=1 will do. I want to be able to
modify the table so I can set a variable for each column so I can tell
whether I can let a user modify that field. If I modify the fieldname
i have a query:
mysql_query(update members set where '$edit[company]'='$company)
anyways there are 2 sources using this query.. one that needs the
$edit[company] marker and another one that uses a $company marker.. any way
i can make that 1 query deal with both sources?
and i also
I have the following query:
$query = SELECT d.utilization, d.capacity_date, d.day, i.id, i.interface, cd.date,
cd.id ;
$query .= FROM (capacity_data as d LEFT JOIN interfaces as i ON d.interface =
i.id) ;
$query .= LEFT JOIN capacity_date as cd ON d.capacity_date=cd.id ;
$query .=
Shouldn't that be:
while($data=mysql_fetch_array($result))
{
//SSLT
}
NOTE: Added ) and changes $query to $result
-Original Message-
From: Van Andel, Robbert [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] MySQL Query Result
To: Van Andel, Robbert; [EMAIL PROTECTED]
Subject: RE: [PHP] MySQL Query Result Question
Shouldn't that be:
while($data=mysql_fetch_array($result))
{
//SSLT
}
NOTE: Added ) and changes $query to $result
-Original Message-
From: Van Andel, Robbert [mailto:[EMAIL PROTECTED]
Sent
At 00:20 01.03.2003, Van Andel, Robbert said:
[snip]
I have the following query:
$query = SELECT d.utilization, d.capacity_date, d.day, i.id, i.interface,
cd.date, cd.id ;
$query .= FROM (capacity_data as d LEFT JOIN interfaces as i ON
d.interface =
and verified that I got nothing back. I don't
know at this point. I'm at a loss.
Robbert van Andel
-Original Message-
From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 3:51 PM
To: Van Andel, Robbert
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] MySQL Query
Vogelsinger
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] MySQL Query Result Question
I had the same thought and it didn't work. I have verified that $cmts[$i] is a
different value then the previous iteration, but the second time through the same data
as the first time through is processed. I've even run
How do you determine whether or not it is faster/more efficient to run a
complicated query or to run multiple simple queries and join / manipulate
the results with PHP?
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
On Wed, 19 Feb 2003, Larry Brown wrote:
How do you determine whether or not it is faster/more efficient to run a
complicated query or to run multiple simple queries and join / manipulate
the results with PHP?
By empirical methods ...
--
PHP General Mailing List (http://www.php.net/)
To
My apologies for the prior html version, I forgot to change back to txt.
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388
On Wed, 19 Feb 2003, Larry Brown wrote:
How do you determine whether or not it is faster/more efficient to run a
complicated query or to run multiple simple
I know this isn't a PHP question per se, but it does relate to PHP
development.
Every day I work with MySQL as my PHP database, I become more dissalusioned
with its ability as a database server. Yes its fast, but its missing so many
useful features of other DB servers. I'm digressing...
Is
://thehostingcompany.us
-Original Message-
From: Sean Malloy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 9:37 PM
To: PHP General
Subject: [PHP] MySQL Query - Not PHP Specific
I know this isn't a PHP question per se, but it does relate to PHP
development.
Every day I work with MySQL as my PHP
IFNULL! thanks
-Original Message-
From: Daniel Kushner [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 16 January 2003 1:51 PM
To: Sean Malloy; PHP General
Subject: RE: [PHP] MySQL Query - Not PHP Specific
http://www.mysql.com/documentation/mysql/bychapter/manual_Tutorial.html#Work
How do i make a form that will allow me to add 2 to the value of a MySQL
field? I am trying to change it from 75 to 77. Is this possible?
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
mysql_query(update table set field=field+1 where whatever='whatever');
Steven M wrote:
How do i make a form that will allow me to add 2 to the value of a MySQL
field? I am trying to change it from 75 to 77. Is this possible?
Thanks
--
The above message is encrypted with double rot13
Leif
Many thanks for that, your help is much appreciated. *smiles*
Steven M
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I use the script below to get one value out of a database:
$result = mysql_query(select euro from brandstofprijzen where id=2)
or die (mysql_error());
while ($row = mysql_fetch_array($result))
{
$euro = $row[euro];
}
mysql_free_result($result);
This is working fine, but is there an easier (less
-
From: Chris Schoeman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 10, 2002 10:53 AM
Subject: [PHP] mysql query
I use the script below to get one value out of a database:
$result = mysql_query(select euro from brandstofprijzen where id=2)
or die (mysql_error());
while ($row
I am getting a failed query error message. Could someone take a look and let
me know.
//F U N C T I O N S
//=
function AddSignupRequest($Signup_FName, $Signup_LName, $Signup_Address1,
$Signup_Address2, $Signup_City,
$Signup_State, $Signup_Zip, $Signup_Email, $Signup_Phone,
I did some more testing and I found that I forgot the first field in the
columns section of the Statement. So now it looks like this:
I also copy and pasted the statement into PHPMYADMIN and it worked fine. It
just doesn't work here
function AddSignupRequest($Signup_FName, $Signup_LName,
[snip]
/* Performing SQL query */
$query = INSERT INTO SignupRequests ('FirstName', 'LastName',
'Address1', 'Address2',
'City', 'State', 'Zip', 'Email', 'Phone', 'ContactMethod', 'Date',
'IP', 'Status', 'Comments')
VALUES ('', 'Chris', 'Crane', '655 Talcottville Road', 'Apt.
Initially there was an error with too many values verses columns. But I
think it was fixed. I am double checking now.
Jay Blanchard [EMAIL PROTECTED] wrote in message
003201c24d07$b8560470$8102a8c0@000347D72515">news:003201c24d07$b8560470$8102a8c0@000347D72515...
[snip]
/* Performing SQL
There are 15 columns and 15 pieces of data. In my second post I fixed this
error and pasted it into PHPMYADMIN and it worked fine, but not here...
Chris Crane [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Initially there was an error with too many values
101 - 200 of 300 matches
Mail list logo