1

I have searched and searched this and only found information for MySQL variables, which is not what I want. What I do want is to run the same SQL from my PHP that I do from the command line, that means providing input to the SQL script/file

I've tried:

mysql -u root -p dev < page.sql '/';
mysql -u root -p dev < page.sql /;

etc

or basically

mysql -u root -p dev < page.sql 'My Title';

where the file is

select * from content where id=?

I've run this from the command line successfully:

mysql -u root -p dev < content.sql

content.sql:

select * from content

but I cant get it done with the parameter, I'm doing this because I'm using PHP's PDO and see no reason why I shouldn't by able to run that sql from the command line. If anyone could help me I'd appreciate it, I've already set my env var and file privilege, Thanks...

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
nwooten
  • 11
  • 1

0 Answers0