PHP - SQLSTATE[HY093]: Invalid parameter number

Status
Not open for further replies.

Berk

berkibap#4233
Developer
Oct 17, 2015
863
190
Hey,
I'm getting this error with this code, can you guys help me out?
PHP:
<?php 
    $inboxq = $db->prepare("SELECT * FROM inbox WHERE user_one = :u OR user_two = :u");
    $username = $_SESSION['user']['username'];
    $inboxq->bindValue(':u', $username, PDO::PARAM_STR); 
    $inboxq->execute();
    $inboxq = $inboxq->fetchAll();
    foreach($inboxq as $inbox ){ ?>
    <div class="box">
             <div class="card-panel"  style="
             background: url(https://www.avatar-retro.com/habbo-imaging/avatarimage.php?figure=hd-180-1.ch-210-66.lg-270-82.sh-290-91.hr-100-&amp;action=wav&amp;direction=2&amp;head_direction=3&amp;gesture=sml&amp;size=l) right no-repeat rgba(45, 104, 128, 0.56);">
                  <small style="color:white;margin-top:20px;border-botton: 1px solid white;"><?= $inbox['user_one']; ?></small>
                                         
                 
                   <h6 style="color:white;
                   padding-right: 5; right: 100px; width: 50%; overflow: hidden;"><?= $inbox['msg']; ?> </h6>
<?php } ?>
I don't get what's wrong, I hope you guys can help me.
 
Thread can be closed, had to change user_two's parameter to :u2 and it's fixed.
 
Status
Not open for further replies.

Users who are viewing this thread

Top