Jump to content

[SOLVED] query an sql table in PHP


jealy

Recommended Posts

Hey guys.

 

I'm trying to make a simple page that will query a mysql table for names of movies.

 

I have most of it done however when you click on the letter, it shows all of the results with the letter in the name, I want it to show results that BEGIN with the letter, it's hard to explain but...

 

 

http://camo.jealy.co.uk = the page

 

Here's the line;

$sql="SELECT Name FROM films WHERE Name LIKE '%" . $letter . "%'";

 

I just pretty much need to know the syntax or whatever they're called to find it if it begins with the $letter, instead of if it's "LIKE" it.

Link to comment
https://forums.phpfreaks.com/topic/122007-solved-query-an-sql-table-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.