sql statemnet
Moderator: General Moderators
-
pinehead18
- Forum Contributor
- Posts: 329
- Joined: Thu Jul 31, 2003 9:20 pm
sql statemnet
$sql = "SELECT * FROM $table WHERE pic1 <> "default.gif" ORDER BY id
DESC LIMIT $page,$limit";
What is wrong with this?
DESC LIMIT $page,$limit";
What is wrong with this?
-
pinehead18
- Forum Contributor
- Posts: 329
- Joined: Thu Jul 31, 2003 9:20 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you need to escape the quotes you have in that string, as evidenced here:
Code: Select all
$sql = "SELECT * FROM $table WHERE pic1 <> "default.gif" ORDER BY id
DESC LIMIT $page,$limit";-
pinehead18
- Forum Contributor
- Posts: 329
- Joined: Thu Jul 31, 2003 9:20 pm
-
pinehead18
- Forum Contributor
- Posts: 329
- Joined: Thu Jul 31, 2003 9:20 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Basic Strings 101:
Code: Select all
$string = "blahblah"; // a simple string
$string = "blahblah "secondary string" blahblha"; // double quotes inside a double quote string. Variables inside the string are transformed.
$string = 'blahblah'; // another simple string
$string = 'blahblah "secondary string" blabhlah'; // double quotes inside a single quote string do not need escaping. Variables inside the string are [u]not[/u] transformed.-
pinehead18
- Forum Contributor
- Posts: 329
- Joined: Thu Jul 31, 2003 9:20 pm