1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <!DOCTYPE html><html><body><?php
function db()
{
$x='xxxxxxxxxx';
$y='xxxxxx';
$z='xxxxxxxx';
$o= array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
$db=new PDO($x,$y,$z,$o);
return $db;
}
$db=db();
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
function toto()
{
$s="SELECT user_id FROM perso_candidature WHERE id =102";
$r=$db->query($s);
while($w=$r->fetch(PDO::FETCH_OBJ))
{
$uid=$w->user_id;
}
echo $uid;
}
toto();
?></body></html> |
Partager