Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Ryan A
On 4/9/2004 5:22:12 PM, John Nichel ([EMAIL PROTECTED]) wrote: > John W. Holmes wrote: > > From: "John Nichel" <[EMAIL PROTECTED]> > > > >>>Don't use single quotes. > >>> > >> > >>$sql = "INSERT INTO table (id, name) VALUES ( '" . $id . "', '" . $name > >>. "') > > > > > > awww, come on... someone

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread John Nichel
John W. Holmes wrote: From: "John Nichel" <[EMAIL PROTECTED]> Don't use single quotes. $sql = "INSERT INTO table (id, name) VALUES ( '" . $id . "', '" . $name . "') awww, come on... someone besides me had to understand wtf Ryan was blabbering about, right ;) ;) ;) ---John Holmes... I have

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Ryan A
> You have to eval() the code from the database to get the variables > replaced > (or use a regex). > > $name = 'John'; > $str = file_get_contents('test.txt'); //Reads "Hello $name" > eval('$str = "' . $str . '";'); > echo $str; > ?> Hi John, That didn't work (eval i dont know regex well enou

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread John W. Holmes
From: "John Nichel" <[EMAIL PROTECTED]> > > Don't use single quotes. > > > > $sql = "INSERT INTO table (id, name) VALUES ( '" . $id . "', '" . $name > . "') awww, come on... someone besides me had to understand wtf Ryan was blabbering about, right ;) ;) ;) ---John Holmes... -- PHP General

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread John Nichel
Jason Wong wrote: On Friday 09 April 2004 22:24, Ryan A wrote: If that is the case you could modify your insert query: INSERT INTO table (id, name) VALUES ('$id', '$name') No, thats not the problem, its inserting the text "$id" and "$name" instead of the values the variables hold. Don't use sin

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Jason Wong
On Friday 09 April 2004 22:24, Ryan A wrote: > > If that is the case you could modify your insert query: > > INSERT INTO table (id, name) VALUES ('$id', '$name') > > No, thats not the problem, its inserting the text "$id" and "$name" instead > of the > values the variables hold. Don't use single

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]> > 2. The query also checks if I have a stored sql statement for this C_ID > 2a. If "YES" it tries to execute the query (if NO, execution stops here, all > is well) > > 3.The stored SQL is usually something like "insert into > tester('$client_id','$client_name')"

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Ryan A
Hey Richard, Thanks for replying. > If that is the case you could modify your insert query: > INSERT INTO table (id, name) VALUES ('$id', '$name') No, thats not the problem, its inserting the text "$id" and "$name" instead of the values the variables hold. Ideas? Thanks, -Ryan > > > Hi, > >

Re: [PHP] Problem running sql stored in the database

2004-04-09 Thread Richard Harb
Not quite sure what you mean... So I assume the data was written into the worng fields. If that is the case you could modify your insert query: INSERT INTO table (id, name) VALUES ('$id', '$name') hth Richard Friday, April 9, 2004, 4:11:05 PM, you wrote: > Hi, > I am getting 2 values from a fo

[PHP] Problem running sql stored in the database

2004-04-09 Thread Ryan A
Hi, I am getting 2 values from a form: $client_id and $client_name (for understanding: client_id = '12' name='ryan') when the client submits the form: 1. I run a query in my php script inserts this data into the db,assigns a C_ID. 2. The query also checks if I have a stored sql statement for thi