PHP Code Help fix php code to update database

PHP Code Help fix php code to update database

I am new to php and spent hours trying to get some code to work, looking for someone to fix my code so that it works..I have the code below, I am trying to get it to show a random url in an iframe, which i have working...However, for the life of me, I cannot get it to update the associated row and deduct 1 credit.
So, this job is for $10 for someone to fix my code so that it pulls a random url from database and puts it in iframe, and then deducts 1 credit from the ID / row that it pulled the url from.

Below is the code I have...


include 'config.php'; ?>


$result = mysqli_query($conn,"SELECT id, url FROM oto_msites order by RAND() limit 1"); ?>



while($row = mysqli_fetch_array($result)) {



mysqli_query($conn,"UPDATE oto_msites SET credits = credits-1 WHERE id = echo .$id."); ?>


<iframe border="0" frameborder="0" height="100%" width="100%" id="banner" marginheight="0" marginwidth="0" scrolling="yes" src="<?php echo $row["url"]; ?>"></iframe>







Get the php code working so that it pulls random url from database to show in iframe and then deducts 1 credit from the id / row that it pulled url from.

Skills Required



i am an expert php developer.
i can fix your code right now.

here is my porfolio:

i got the error. if you hire me it&#39;s take 10 to 15 minutes to fix, looking forward...

hello, i’m maruf, a full-stack web application developer and web designer.
hope i can solve your code problem.
if you order me, need some extra info i will ask you later.

thanks in advance

i will fix your php code within few minutes. i carefully have gone through your job description and willing to work with you. i put all my efforts and skills to develop a masterpiece for you.

looking forward to your positive response and possibly work with you.

thank you so much for your time and consideration.

Bid On Listing Created 1 year ago in Programming

Other jobs by nabennett