Hi,
I have a database with members details and PK is id.
$thing = [EMAIL PROTECTED];
$query = SELECT id, email, familyname FROM members WHERE email=$thing;
$result = mysql_query($query);
If i do a query where id=$thing.
and $thing=20;
this works fine and I get the desired result. But what is
$thing = [EMAIL PROTECTED];
$query = SELECT id, email, familyname FROM members WHERE
email=$thing;
You need to quote non-numeric values in SQL. It should be
$query = SELECT id, email, familyname FROM members WHERE
email=''$thing';
Also, you don't really need to select the email value since you
--- Harry G [EMAIL PROTECTED] wrote:
Hi,
I have a database with members details and PK is id.
$thing = [EMAIL PROTECTED];
$query = SELECT id, email, familyname FROM members
WHERE email=$thing;
Make it
$query = SELECT id, email, familyname FROM members
WHERE email='$thing';
It should
On Friday 23 July 2004 10:57, Harry G wrote:
I have a database with members details and PK is id.
$thing = [EMAIL PROTECTED];
$query = SELECT id, email, familyname FROM members WHERE email=$thing;
$query = SELECT id, email, familyname FROM members WHERE email='$thing';
Please refer to
My IF statement should be picking up on the numbers, and if the number
matches not be displaying out the information, however I look at the
outputted page and the information is still there, what have I got wrong
on the code?
CODE SNIPPET
//Show categories first
$get_cats = select id_num,
I've just tried to do something I've done a thousand times. It does not
work. I've checked all of the syntax, made sure the field and variable
names are correct. No matter what I do it just doesn't work. The table
remains empty. Here's the query:
$logit = mysql_query(INSERT INTO log SET
script.
If you can't see the problem after this post the output of this code.
- Original Message -
From: Axel IS Main [EMAIL PROTECTED]
To: PHP-DB [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 9:05 AM
Subject: [PHP-DB] What's wrong with this query?
I've just tried to do something
IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 7:06 PM
To: PHP-DB
Subject: [PHP-DB] What's wrong with this query?
I've just tried to do something I've done a thousand times. It does not
work. I've checked all of the syntax, made sure the field and variable
names are correct
, February 26, 2004 11:05 AM
Subject: [PHP-DB] What's wrong with this query?
I've just tried to do something I've done a thousand times. It does not
work. I've checked all of the syntax, made sure the field and variable
names are correct. No matter what I do it just doesn't work. The table
remains
[mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've used
this syntax
for a long time and so far there hasn't been a problem I'll assume
that's not the problem. I
; [EMAIL PROTECTED]; PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
exactly, i'm using it for more than a year
- Original Message -
From: Erwin Kerk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; PHP DB [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 5:36 PM
Subject: Re: [PHP-DB
PROTECTED]
Sent: Thursday, February 26, 2004 7:06 PM
To: PHP-DB
Subject: [PHP-DB] What's wrong with this query?
I've just tried to do something I've done a thousand times. It does not
work. I've checked all of the syntax, made sure the field and variable
names are correct. No matter what I do it just
to the list and maybe one of us will find
something.
HTH.
Rich
-Original Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've
[mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've used
this syntax
for a long time and so far there hasn't been a problem I'll assume
that's not the problem. I
. If nothing is apparent,
post the results of echo $sql back to the list and maybe one of us will
find something.
HTH.
Rich
-Original Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've used
this syntax
for a long time and so far there hasn't been a problem I'll assume
that's not the problem. I will, however, review this and
probably make
some changes
will find
something.
HTH.
Rich
-Original Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've used
this syntax
$sql back to the list and maybe one of us will find
something.
HTH.
Rich
-Original Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about
Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 2:37 PM
To: PHP DB
Subject: Re: [PHP-DB] What's wrong with this query?
Ok, ok. I get the message about the syntax. Since I've used
this syntax
for a long time and so far there hasn't been a problem I'll
What about the single quotes? Might try this.
$sql = INSERT INTO log SET term=\'$search\', returns=\'$arrayword\',
time=CURTIME(), date=CURDATE(), ip=\'$ip\';
$sql = INSERT INTO log SET term='$search', returns='$arrayword',
time=CURTIME(), date=CURDATE(), ip='$ip';
echo $sql;
$logit =
Ok, ok. I get the message about the syntax. Since I've used this syntax
for a long time and so far there hasn't been a problem I'll assume
that's not the problem. I will, however, review this and probably make
some changes for the sake of compliance if nothing else. In any event,
the syntax is
exactly, i'm using it for more than a year
- Original Message -
From: Erwin Kerk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; PHP DB [EMAIL PROTECTED]
Sent: Thursday, February 26, 2004 5:36 PM
Subject: Re: [PHP-DB] What's wrong with this query?
Viorel Dragomir wrote:
I'm using MySQL
Viorel Dragomir wrote:
I'm using MySQL for about 2 years and never heard about this kind of INSERT.
Is not SQL compliant neither.
YOU CAN NOT MAKE : INSERT INTO table SET var=1 [as I know]
As a matter of fact it IS possible, according to the MySQL manual on
http://www.mysql.com/doc/en/INSERT.html
Here's the code: with some extraneous html removed to make it easier to
read...
? require('connect.php') ?
?
/* check for a request to display a new fg number and if so make sure the
data is good
if the fg number is good it is used for all other data queries */
$fgNumber=;
if ($switchfg
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] What's wrong with my update query select works,
but update doesn't?
Here's the code: with some extraneous html removed to make it easier to
read...
? require('connect.php') ?
?
/* check for a request to display a new fg number and if so make sure
Hi all, I'm running PHP4. What's wrong with this code:
?
$db = mysql_connect(localhost, Taj, wyethia);
mysql_select_db(s2s,$db);
mysql_query(INSERT INTO prod VALUES ( 'Name', 'ShortDesc', 'LongDesc',
'PriceOZ', 'PriceLB', 'URLOZ', 'URLLB', 'IMG') VALUES ('$_POST[Name]',
'$_POST[ShortDesc]',
Hi all, I'm running PHP4. What's wrong with this code:
?
$db = mysql_connect(localhost, Taj, passwordhere);
mysql_select_db(s2s,$db);
mysql_query(INSERT INTO prod VALUES ( 'Name', 'ShortDesc', 'LongDesc',
'PriceOZ', 'PriceLB', 'URLOZ', 'URLLB', 'IMG') VALUES ('$_POST[Name]',
I'd use var inclusions like this;
VALUES (' . $_POST['Name'] . ',
that might help you
// -Original Message-
// From: Shoulder to Shoulder Farm [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 2 September 2002 11:42 AM
// To: PHP Database List
// Subject: [PHP-DB] What's wrong
I am trying an email verification function, like this:
if (empty($useremail)) || !eregi(^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]
+.[A-Za-z0-9\_-]+.*, $email))
{
$errmsg .= The email address appears to be invalid\n;
}
But it will not work, on one server I get this
Well, one thing is you've got mismatched parentheses. You need another
another opening paren right after the if.
Also, don't you need to escape the last hyphen in your character sets?
As well as the . before the third character set?
-Steve
On Tuesday, August 20, 2002, at 11:11 AM, [EMAIL
Steve Cayford [EMAIL PROTECTED] wrote on 08/20/2002 10:28:46 AM:
Well, one thing is you've got mismatched parentheses. You need another
another opening paren right after the if.
Also, don't you need to escape the last hyphen in your character sets?
As well as the . before the third
hi all
i've been trying this script for a day and i just can't figure out why it
doesn't work. could someone check and see if there is something i did
wrong? the error is unknown function include_menu() which actually exist
in the menu.inc file.
this is the structure:
home.php
includes
i'm not sure why the files didn't come through. i'll try again.
-Original Message-
From: Ali Nayeri [mailto:[EMAIL PROTECTED]]
Sent: January 27, 2002 8:18 PM
To: PHP Database Mailing List
Subject: [PHP-DB] what's wrong with this?
hi all
i've been trying this script for a day and i
can't you attach files in this mailing list? is there a special way? could
someone tell me.
Thanks
-Original Message-
From: Ali Nayeri [mailto:[EMAIL PROTECTED]]
Sent: January 27, 2002 8:27 PM
To: PHP Database Mailing List
Subject: RE: [PHP-DB] what's wrong with this?
i'm not sure
Ho there...I really wonder what's wrong with this script. The error is in
this line below:
if((count($info) != 1) ($folder == $info[2])) echo tabletrtda
href= . $info[1] . . $info[0] . /abr/td/tr/table;
The condition ($folder == $info[2]) is not working!
I hope you can help me!
Here's the code:
($info[2]))
HTH
Dobromir Velev
-Original Message-
From: Sergio Augusto Bitencourt Petrovcic [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Date: Tuesday, November 20, 2001 13:58
Subject: [PHP-DB] What's wrong?
Ho there...I really wonder what's wrong with this script. The error
Tx.
Yep I have read it now and understood it better than the first time I read
this part of the manual (it's amazing how things make more sense when you
can apply them to what you are doing).
Jesse Goerz [EMAIL PROTECTED] wrote in message
Please could some take a look at this code and tell me why when I take my IF
statements out of the function and put in them in the same place where I
call the function from they work, but as soon as I replace them with the
function name they don't?
Appreciate any help.
torrent
Here's the
On Tue, 30 Oct 2001, TorrentUK wrote:
SNIP
you either need to pass the variables to the function or use global
variables in the function see
http://www.php.net/manual/en/language.variables.scope.php
Here's the code...
// Define the rating's filter
?php
function RatingFilter () {
- possibly at different stages of the program - like before and
after you call your function.
Good luck!
-Natalie
-Original Message-
From: TorrentUK [SMTP:[EMAIL PROTECTED]]
Sent: Tuesday, October 30, 2001 3:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] What's wrong with my
Yep, that'll be it.
Thanks for the help. :)
torrent
Charles F. McKnight [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Tue, 30 Oct 2001, TorrentUK wrote:
SNIP
you either need to pass the variables to the function or use global
variables in the
Hi,
I really need help, I wrote a function so that I can
call for db user/password in an include file. It looks
like this:
// Connect to the database
function db_connect(){
global $MYSQL_USERNAME, $MYSQL_PASSWORD, $DB,
$HOST;
$db =
Hello...
Try mysql_pconnect instead
Dan
--
From: Emir Musabasic
Sent: Monday, March 26, 2001 9:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] What's wrong with this code?
Hi,
I really need help, I wrote a function so that I can
call for db user
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Emir Musabasic) wrote:
I have user/password/host variables inside a config
file but for some reason when I include this into a
php page when I test it, I get:
Fatal error: Cannot redeclare db_connect() in
44 matches
Mail list logo