1.11M Members

get part of row name in php query

 
0
 

how to get part of col name in query. for ex:

les say i have these rows in table:
id    name      last     address
1     dave      da       new york
2     rand      ra       ohio
3     random     a       new

now i want to get rows where address has a word new in it.

$s=mysql_query("SELECT * FROM 'table' WHERE address ='new'");

so output should be 1st and last row.

 
0
 
$s=mysql_query("SELECT * FROM 'table' WHERE address LIKE '%new%'");

$numrows - mysql_num_rows($s);
for ($i=0;$i<$numrows;$i++) {
    $temp=mysql_fetch_array($s);
    extract ($temp);
}
Question Answered as of 1 Year Ago by tiggsy
Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article