I'm trying to insert some data into a table with shell_exec (on localhost).
Here's the code I'm using:
$shellExec = 'C:\wamp\bin\mysql\mysql5.1.36\bin\mysql -h localhost -u root mm_'.$acname.' INSERT INTO account (acct_name,start_date,active,name,address1,address2,postcode,telephone,website,email,vat_number,vat_amount,start_number,currency) VALUES("'.$company.'","'.$start_date.'","'.$active.'","'.$acname.'","'.$address1.'","'.$address2.'","'.$postcode.'","'.$telephone.'","'.$website.'","'.$email.'","'.$vat_number.'","'.$vat_amount.'","'.$start_number.'","'.$currency.'")';
shell_exec($shellExec);
Which runs as:
C:\wamp\bin\mysql\mysql5.1.36\bin\mysql -h localhost -u root mm_robdunne22 INSERT INTO account (acct_name,start_date,active,name,address1,address2,postcode,telephone,website,email,vat_number,vat_amount,start_number,currency) VALUES("sdfsdfy","10-05-2011","1","robdunne22","fsdfs","dfsd","sdf","3423423434sdfsdf","cvxcvdfg","gfgh55ydddd","sdfs","sdfgggaacc","1","pound")
On the command line.
This fails - on the command line if i run this it just displays the MySQL help information. I think the problem is that logging into MySQL and the INSERT statement should be separate. They work fine if I split them, however I'm not sure how to make this work - either split into two or as one shell command.