Trying to add stuff to my cms (PHP help)

Status
Not open for further replies.

LoneZZ

Member
Oct 8, 2011
56
1
I never coded PHP before, but from looking at the cms I managed to make this:
<li class="icon-vip"><a href="/vip">
<?php
$amvip= mysql_query("SELECT * FROM users WHERE username={username}");
$vipam = mysql_fetch_array($amvip);
if($vipam['vip']==0) { echo '<a href="{url}/vip>Buy VIP!</a>'; } else { echo 'Thank you for buying VIP!';}
?>

</a></li>

I get this error: , I'd like to know how to fix it to start coding more features on my CMS, thanks in advance :D
 

Sean

‫‫‫‫‫‫  ‫  Don't Worry, Be Happy
Dec 12, 2011
1,121
405
PHP:
<?php
 
$amvip = mysql_query("SELECT * FROM `users` WHERE `username`='{username}'");
$vipam = mysql_fetch_array($amvip);
if($vipam['vip'] === 0) {
    echo '<a href="{url}/vip>Buy VIP!</a>';
}
else {
    echo 'Thank you for buying VIP!';
}
 
?>

Try this
 

LoneZZ

Member
Oct 8, 2011
56
1
PHP:
<?php
 
$amvip = mysql_query("SELECT * FROM `users` WHERE `username`='{username}'");
$vipam = mysql_fetch_array($amvip);
if($vipam['vip'] == 0) {
    echo '<a href="{url}/vip>Buy VIP!</a>';
}
else {
    echo 'Thank you for buying VIP!';
}
 
?>

Try this
Thanks, it fixed the error but I have VIP on my account, so 1 in database, but on the CMS it says Buy VIP, and not Thanks for buying it:

EDIT: there was two "=", I tried only putting one and it worked fine, I put 2 on because I had seen it on an RP CMS and thought it was correct, thanks for your help :D

T2PDNsZ.png
 
Status
Not open for further replies.

Users who are viewing this thread

Top