01-01-2008, 01:11 PM
|
#8 (permalink)
|
|
The Addict
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
|
Quote:
Originally Posted by Tanax
PHP Code:
$group = 'TALKPHP';
$sql = sprintf("SELECT * FROM `table_name` WHERE `group` = '%s'", mysql_real_escape_string($group));
$query = mysql_query($sql);
if($query) {
echo 'Woho! The query worked..';
}
else {
echo 'DooH! The query did not work..';
}
Try that! 
|
i try it and here is the answer => DooH! The query did not work..
here is the full code of this page
PHP Code:
<?php
include("config.php");
$group = 'TALKPHP';
$sql = sprintf("SELECT * FROM `table_name` WHERE `group` = '%s'", mysql_real_escape_string($group));
$res = mysql_query($sql) ;
if($res) {
echo 'Woho! The query worked..';
}
else {
echo 'DooH! The query did not work..';
}
while ($row = mysql_fetch_array($res) ) {
echo "id : ".$row[id]."<br>" ;
echo "titre : ".$row[title]."<br>" ;
echo "resumé : ".$row[resume]."<br>" ;
echo "note : ".$row[rate]."<br>" ;
echo "écris le ".$row[date]."<br>" ;
}
?>
|
|
|