View Single Post
Old 01-01-2008, 01:11 PM   #8 (permalink)
webtuto
The Addict
 
webtuto's Avatar
 
Join Date: Dec 2007
Location: morocco
Posts: 221
Thanks: 19
webtuto is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
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>" ;

?>
Send a message via MSN to webtuto Send a message via Yahoo to webtuto Send a message via Skype™ to webtuto
webtuto is offline  
Reply With Quote