Jump to content

[SOLVED] WHERE LIKE problem.


Verbat

Recommended Posts

This is the code i have -

 

$query8 = sprintf("SELECT * from test WHERE username LIKE '%a%'",$db_connect); 
$result8 = dbquery($query8);
while ($rpw = mysql_fetch_assoc($result8) ) {
$username = $rpw['username'];
echo "$username";
}

 

I tryed to work it with some VAR info but it didnt work so i made a simple search code like this and for some reason it doesnt work.

What am i doing wrong? :)

Link to comment
https://forums.phpfreaks.com/topic/87538-solved-where-like-problem/
Share on other sites

well what is dbquery did you write that function... for a matter of simplicity it should of been

 

$query8 = "SELECT * from test WHERE username LIKE '%a%'"; 
$result8 = mysql_query($query8);
while ($rpw = mysql_fetch_assoc($result8) ) {
$username = $rpw['username'];
echo "$username";
}

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.