Jump to content

Select data from db using first letter *Solved*


Gruzin

Recommended Posts

Hi guys,
I want to pull out the info form db using first letter. For example I want to display all records begining on A or B. I've tryed something like this, but it displays all the records....

[code]$sql = mysql_query("SELECT * FROM Mater WHERE MatName LIKE 'a%'");
while($row = mysql_fetch_array($sql)){
echo $row['MatName']."<br>";
}[/code]

Thanks for your help,
George

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.