Search MySQL Row

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

snike

Established Member
Impact
3
How would i search a mysql row? Can someone help? lol.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Can you explain it a little more?..
 
0
•••
Do you mean get information from a row? Or do you wish to build a search engine on your site?
 
0
•••
I want PHP to find data in a mysql row and I want php delete that data. For example.

My sql has this:
column name: numbers
first row has this data: 1 , 3 ,5, 6, 7

and PHP should find 5 and delete it.

so the row would now has this: 1 , 3 , 6, 7
 
0
•••
PHP:
$query = "SELECT * FROM TABLE WHERE id = 7"; // 7 :)
$result = mysql_query($query);

$row = mysql_fetch_array($result);
foreach ($row as $key => $value) {
  if (strstr($value, 5)) { // You want to find 5 in the item
    $value = str_replace(5, '', $value);
    $id = $row['id'];
    mysql_query("UPDATE table SET $key = '$value' WHERE id = $id");
  }
}
Not sure if it will work.. but, eh.
 
0
•••
thanks dan and sorry about asking so many questions...
 
0
•••
Warning: Invalid argument supplied for foreach() in /home/dstorm/public_html/buroku/store/row.php on line 6

I got this error
 
0
•••
plz...help
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back