Topic: sql query
hello,
i m trying to interact with punbb with no success.
here is my query :
<?php
//for punbb login and function access
define('PUN_ROOT', './forum/');
require PUN_ROOT.'include/common.php';
//punbb authentication
$groupid = $pun_user['g_id'];
$username = $pun_user['username'];
$useremail = $pun_user['email'];
$userid = $pun_user['id'];
?>
<?php
if (!$pun_user['is_guest'])
echo 'hello! '.pun_htmlspecialchars($pun_user['id']);
else { echo 'please login! '.pun_htmlspecialchars($pun_user['id']);
?>
<?php } ?>
<?php
{
$sql = 'SELECT * FROM favoris WHERE userid = '.$pun_user['id'];
$req = mysql_query($sql) ;
if (!$req) { die("/!\ Erreur SQL: " . mysql_error()); }
while ($data = mysql_fetch_array($req))
echo 'yo! '.pun_htmlspecialchars($pun_user['id']);
echo "\n";
echo " </b><img src=\"img/art/pc_".$albumid.".ab\" ><br />";
echo "\n";
}
?>
the query as no result, i dunno how to put the pun user id in my sql query : $sql = 'SELECT * FROM favoris WHERE userid = '.$pun_user['id']; ??
anyone can help ?