> $sql = "INSERT INTO x VALUES ({$_SESSION['add']['name']} ";
>
> oh, and unless add & name are actually constants you should always wrap
> them in single quotes. (php will covert the non-exstent constant into a
> string a issue an E_NOTICE + its overhead)
well that got me on the right track..
user curly braces around your arrays in the string e.g:
$sql = "INSERT INTO x VALUES ({$_SESSION['add']['name']} ";
oh, and unless add & name are actually constants you should always wrap
them in single quotes. (php will covert the non-exstent constant into a
string a issue an E_NOTICE + its
Tuesday, April 6, 2004, 1:21:52 AM, you wrote:
> hi...
> i cant cut and paste my exact mysql query because it takes the ''
> stuff out doubles the $'s and the ,'s in the whole thing (dont know
> why but anyways...)...
> i have a query that goes something like this:
> mysql_query("insert into $Gue
hi...
i cant cut and paste my exact mysql query because it takes the '' stuff out doubles
the $'s and the ,'s in the whole thing (dont know why but anyways...)...
i have a query that goes something like this:
mysql_query("insert into $GuestbookTable values(NULL, '$_SESSION[add][date]',
'$_SESSIO
al Message -
From: "Brian Rue" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 17, 2001 8:33 AM
Subject: [PHP] mysql_query() problem
> Hi,
>
> I'm getting the error
> <>
>
> from this code:
>
> function validateUser($us
Hi,
I'm getting the error
<>
from this code:
function validateUser($username,$password) {
$conn = connectToMySQL();
mysql_select_db($db_name,$conn);
$query="select * from members where username='".$username."' AND
password='".$password."'";
$result = mysql_query($query,$conn);
if (mysql_nu
is ol' fool.
Cheers,
Brad
> From: "Christopher Allen" <[EMAIL PROTECTED]>
> Date: Tue, 17 Jul 2001 09:11:05 -0500
> To: "Brad Wright" <[EMAIL PROTECTED]>
> Subject: Re: [PHP] mysql_query problem (more suggestions)
>
> not right because this
> > From: Alvin Tan <[EMAIL PROTECTED]>
> > Date: Tue, 17 Jul 2001 14:38:58 +0800
> > To: Brad Wright <[EMAIL PROTECTED]>, Jason Murray
> > <[EMAIL PROTECTED]>, PHP General List
> > <[EMAIL PROTECTED]>
> > Subject: Re: [PHP] mysql_query pr
lvin Tan <[EMAIL PROTECTED]>
> Date: Tue, 17 Jul 2001 14:38:58 +0800
> To: Brad Wright <[EMAIL PROTECTED]>, Jason Murray
> <[EMAIL PROTECTED]>, PHP General List
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] mysql_query problem (more suggestions)
>
> Hi ag
L PROTECTED]>, PHP General List <[EMAIL PROTECTED]>
> > Subject: RE: [PHP] mysql_query problem (more suggestions)
> >
> >> Unless i have actually defined a function 'password()', calling 'echo
> >> password('$password') will (...does, i jus
Jason,
I have tried what yoiu suggested. result is the same.
> From: Jason Murray <[EMAIL PROTECTED]>
> Date: Tue, 17 Jul 2001 15:28:11 +1000
> To: "'Brad Wright'" <[EMAIL PROTECTED]>, Alvin Tan
> <[EMAIL PROTECTED]>, PHP General List <[EMAIL
> Unless i have actually defined a function 'password()', calling 'echo
> password('$password') will (...does, i just double checked)
> causes a Fatal
> Error 'Undefined Function'.
> Nice try tho :)
the original mail said to echo $query, which will include some
text in it that says "password('i
7;echo
password('$password') will (...does, i just double checked) causes a Fatal
Error 'Undefined Function'.
Nice try tho :)
> From: Alvin Tan <[EMAIL PROTECTED]>
> Date: Tue, 17 Jul 2001 13:07:45 +0800
> To: Brad Wright <[EMAIL PROTECTED]>
> Subject:
> $testResult = mysql_query("SELECT * FROM login_table where Pass =
$query = "select * from login_table where Pass=password('$password')";
then echo $query to the screen and make sure you see what needs to be there.
Also try mysql_error etc.. from the manual
GL
--ccma
--
PHP General Mail
Hi all',
I have a mysql_query that reads:
$testResult = mysql_query("SELECT * FROM login_table where Pass =
password('$password')") or die ("ouch");
$num_rows = mysql_num_rows($testResult);
the problem is that I keep getting a value of 0 for $num_rows when I know
the table has 1 entry for PAs
15 matches
Mail list logo