Here is my code:
$sql = "SELECT `description` FROM `auctions` WHERE `description` REGEXP '[0-9]{10}'";
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
echo $row["description"];
}
This returns the whole field description, I need to just get the part that matches the REGEXP, how do I do this using php?
0or1. See the documentation. (and you can see an example here)mysql_*functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.