Hey im messing with a search function currently and i want it to display how many affected lines it is on the table and then echo it. but my code is working but its outputing wrong.
EDIT : Now it just displays 0 and search reseult , i wanna make it search for what they want in the table acksearch and then display how many results there was and then output it and display all that matched.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die("Could not connect: " . mysql_error());
}
mysql_select_db("acksocial");
mysql_query("SELECT * FROM Acksearch WHERE name = name ");
$rc = mysql_affected_rows();
echo "There was " . $rc . " results of your search!";
mysql_close($con);
?>
now it just displays 0 and search reseult , i wanna make it search for what they want in the table acksearch and then display how many results there was and then output it and display all that matched.
First off, Don’t use
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.Not quite sure from the look of your query… but hope this helps