Re: [PHP-DB] mysql_insert_id() and JOIN

2009-07-13 Thread Bastien Koert
[snip] > Sorry my question... but why I must use JOIN if I can use SELECT * FROM > table1 AND table2 AND table3 WHERE table1.id=table2.id=table3 not? > thanks > > +                                                                          _ [/snip] select table1.field1, table1.field2, table2.field

[PHP-DB] Cant get Mysql stored procedure to work.

2009-07-13 Thread Patrick Moloney
I've had no success trying to execute any stored procedure from php. I'm just trying to follow the example for multi-query in the php manual, and have tried an example from Artfulsoftware.com. I have one input and one output parameter. I've simplified the stored procedure to always output one v

Re: [PHP-DB] Cant get Mysql stored procedure to work.

2009-07-13 Thread Bastien Koert
On Mon, Jul 13, 2009 at 11:52 AM, Patrick Moloney wrote: > I've had no success trying to execute any stored procedure from php. > I'm just trying to follow the example for multi-query in the php manual, and > have tried an example from Artfulsoftware.com. I have one input and one > output parameter

Re: [PHP-DB] Cant get Mysql stored procedure to work.

2009-07-13 Thread Patrick Moloney
Bastien Koert wrote: On Mon, Jul 13, 2009 at 11:52 AM, Patrick Moloney wrote: I've had no success trying to execute any stored procedure from php. I'm just trying to follow the example for multi-query in the php manual, and have tried an example from Artfulsoftware.com. I have one input and one

Re: [PHP-DB] Cant get Mysql stored procedure to work.

2009-07-13 Thread Bastien Koert
On Mon, Jul 13, 2009 at 1:33 PM, Patrick Moloney wrote: > Bastien Koert wrote: >> >> On Mon, Jul 13, 2009 at 11:52 AM, Patrick Moloney >> wrote: >>> >>> I've had no success trying to execute any stored procedure from php. >>> I'm just trying to follow the example for multi-query in the php manual,

Re: [PHP-DB] Cant get Mysql stored procedure to work.

2009-07-13 Thread Patrick Moloney
Bastien Koert wrote: On Mon, Jul 13, 2009 at 1:33 PM, Patrick Moloney wrote: Bastien Koert wrote: On Mon, Jul 13, 2009 at 11:52 AM, Patrick Moloney wrote: I've had no success trying to execute any stored procedure from php. I'm just trying to follow the example for multi-query in the php manua

[PHP-DB] trying to dump out table info

2009-07-13 Thread Govinda
Hi all I am not sure why this is failing/giving error. I am quite new at PHP/ Mysql, and apologize for what will undoubtedly end up being a trivial error on my part. Here is my code: $db_billing=mysql_connect(localhost,metheuser,mypass,billing); if (!$db_billing) { die('Could not connect: '

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Daniel Brown
On Mon, Jul 13, 2009 at 16:53, Govinda wrote: > Hi all > > I am not sure why this is failing/giving error.  I am quite new at > PHP/Mysql, and apologize for what will undoubtedly end up being a trivial > error on my part. Hey, I recognize that code ;-P > Here is my code: > > $db_billing=m

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Govinda
On Jul 13, 2009, at 2:58 PM, Daniel Brown wrote: On Mon, Jul 13, 2009 at 16:53, Govinda wrote: Hi all I am not sure why this is failing/giving error. I am quite new at PHP/Mysql, and apologize for what will undoubtedly end up being a trivial error on my part. Hey, I recognize that c

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Daniel Brown
On Mon, Jul 13, 2009 at 17:24, Govinda wrote: > > "No database selected" You're getting warmer How would you select a MySQL database in PHP? (Hint: there's a built-in function.) -- [email protected] || [email protected] http://www.parasane.net/ || http://www.pilotpig.net/ C

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Govinda
On Jul 13, 2009, at 4:40 PM, Daniel Brown wrote: On Mon, Jul 13, 2009 at 17:24, Govinda wrote: "No database selected" You're getting warmer How would you select a MySQL database in PHP? (Hint: there's a built-in function.) To try and follow your lead and focus just on what yo

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Daniel Brown
On Mon, Jul 13, 2009 at 19:28, Govinda wrote: > >        $db_billing=mysql_connect(localhost,metheuser,mypass,billing); >if (!$db_billing) { die('Could not connect: ' . mysql_error()); } if(!mysql_select_db('dbname',$db_billing)) die(mysql_error()); >        //$sql = "SHOW TAB

[PHP-DB] simple INSERT statement with placeholders failing. I don't understand why.

2009-07-13 Thread Govinda
this: $q=mysqli_query($db_billing,'INSERT INTO billing (clientFname, clientLname) VALUES (?,?)', array($defaultsFormVars[clientFname], $defaultsFormVars[clientLname])); is giving Warning: mysqli::query() expects parameter 2 to be long, array given in /home/meee/public_html/somedir/test.ph

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Govinda
On Jul 13, 2009, at 5:42 PM, Daniel Brown wrote: On Mon, Jul 13, 2009 at 19:28, Govinda wrote: $db_billing=mysql_connect(localhost,metheuser,mypass,billing); if (!$db_billing) { die('Could not connect: ' . mysql_error()); } if(!mysql_select_db('dbname',$db_billing

Re: [PHP-DB] trying to dump out table info

2009-07-13 Thread Daniel Brown
On Mon, Jul 13, 2009 at 20:17, Govinda wrote: > > Dan, I am really making the effort..  despite how it may look. I believe you. I sent you the function and code that should work for you, but it may have been lost in the chopped replies. So it'll be something like this: -- daniel.br...@p

Re: [PHP-DB] simple INSERT statement with placeholders failing. I don't understand why.

2009-07-13 Thread Niel Archer
> this: > > $q=mysqli_query($db_billing,'INSERT INTO billing (clientFname, > clientLname) VALUES (?,?)', array($defaultsFormVars[clientFname], > $defaultsFormVars[clientLname])); > > is giving > Warning: mysqli::query() expects parameter 2 to be long, array given > in /home/meee/public_html