₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,366 members, 8,421,569 topics. Date: Saturday, 06 June 2026 at 04:33 PM

Toggle theme

Php Mysql Help - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersPhp Mysql Help (659 Views)

1 Reply

Php Mysql Help by guru01(op): 7:34pm On Feb 08, 2012
Hello,
i tried to read out data from a specific date from mysql database.
What i wanted is for php to get all the data from the database within a specific date i enter, but it seems that the script just get only the first role of data and leave out the rest.
Pls can i get a code that can achieve this.
Re: Php Mysql Help by guru01(op): 8:10pm On Feb 08, 2012
<?php
if(isset($_REQUEST['query']))
{
$searchQuery = $_POST['data-search'];

//connceting to db
$con = mysql_connect($_SERVER['SERVER_NAME'],'root','');
if(!$con)
{
die("Error connecting: ".mysql_error());
exit;
}
//selecting db
$dbSelect = mysql_select_db("directory",$con);
$query = "SELECT * FROM websites WHERE Date LIKE '$searchQuery'";
//executing query
$result = mysql_query($query,$con);
if(!$result)
{
die("Could not connect: ".mysql_error());
}
while($row = mysql_fetch_array($result))
{
$searchOutput = "<html><body><table border=1><tr><td>Website Title</td><td>Website URL</td><td>About Website Content</td></tr>
<tr><td>".$row['Title']."</td><td>".$row['URL']."</td><td>".$row['Content']."</td></tr></table>";
}
$searchSuccess = "<p>Your Search was successful</p</body></html>";
mysql_close($con);
echo $searchOutput;
echo $searchSuccess;

}
else{
echo "Invalid";
}

?>
1 Reply

Php/mysql Pin And Serial Number Generation ScriptWamp Server Ebook Ft Install Wamp, Write Php / Mysql / Mysql ConsoleLearn Cakephp, Php/mysql For Free With Video Tutorials234

Web Developer WantedNew Accommodation Website And Forum(for Nigerian Univeristies)Can Anyone Tell Me Of A Better Investment Than This?