What am I doing wrong on PDO?

Status
Not open for further replies.

Proximity

IDK?
Feb 13, 2014
673
56
<?php
$getlooks = pdoengine::connect()->prepare("SELECT * FROM users WHERE id = '".$_SESSION['user']['id']."'");
$getlooks->execute();
$data = $getlooks->fetchAll();
foreach ($stats as $data) {
}
?>

on head and then this is what I am trying to pull

<?php echo $stats['id']; ?>
 

Proximity

IDK?
Feb 13, 2014
673
56
<?php$getlooks = pdoengine::connect()->prepare("SELECT * FROM users WHERE id = '".$_SESSION['user']['id']."'");
$getlooks->execute();
$data1 = $getlooks->fetchAll();
foreach ($stats as $data1) {
//echo $row['whatever row you want']

?>
<div class="c-title orange">%user_name% Stats!</div>
<div class="c-main me">
<div style="align:left;">
<div align="left">
<div><img src="%www%/images/icon_habbo_small.png"> User ID: <b><?php echo $stats['id']; ?></b></div>
<div><img src="%www%/images/credits.png"> Credits: <b><?php echo $stats['credits']; ?></b></div>
<div><img src="%www%/images/duckets.png"> Duckets: <b><?php echo $stats['activity_points']; ?></b></div>
<div><img src="%www%/images/diamond.png"> Diamonds: <b><?php echo $stats['diamonds']; ?></b></div>
<div><img src="%www%/images/owner_icon.gif"> ROTW Points: <b><?php echo $stats['ROTW_Points']; ?></b></div>
<div><img src="%www%/images/terms_icon.gif"> Rank: <b><?php echo $stats['rank']; ?></b></div>
<div><img src="%www%/images/crown.png"> Respects Received: <b><?php echo $statss['respects']; ?></b></div>
<?php
}
?>
One thing I am trying to do....

But that didn't work....
 

Genaga

New Member
Mar 12, 2015
29
8
foreach ($data1 as $stats) try that, I think you have it the wrong way round.

Also do
<pre>
<?php print_r($data1);?>
</pre>
to make sure you're getting the data properly.
 
Last edited:

Thursday

New Member
Dec 2, 2015
27
1
When learning, it is very handy to have a account as the members within their site are extremely helpful with any issues you are having.
 
Status
Not open for further replies.

Users who are viewing this thread

Top