I'm venturing into PHP and MySQL today, on a time-sensitive project. I've managed to do everything I want to do with my database EXCEPT...
I need to select a record set from my table, where a column needs to contain a string of characters.
How would I go about this?
SELECT * from TABLENAME where COLUMN...
I lose it there! Please help me! A search on the various engines yielded little help.
Thanks!
~ Eric
That is exactly what I am using... I need to get all records from the database that have the string "Notary" in the column called "services"
But it is not working at all... MySQL is returning an error on the next line. Any ideas?
basically, you are generally only allowed to have 1 pair of " " in a single line of PHP. The PHP 'interpreter' reads the 2 " " and then kind of thinks Ok that's the end of that. When you open another set of " " it gets very confused.
This is a really dumbed down version of what happens - hey, for me to understand it, it HAS to be simple - but I hope you get the general Jist of things. In future, just try replacing " with ' like sugarkane said and it might work.....does for me half the time!
Rich
One issue to bear in mind with " and ' - true in both Perl and PHP - is that any variables within " " will be evaluated, while within ' ' the variable name will be printed as-is.
[perl]
$foo="bar";
print "$foo"; # output: bar
print '$foo'; # output: $foo
[/perl]