Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Purchase Script Mishaps
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Li1M0ST3Rz" data-source="post: 374650" data-attributes="member: 1271"><p>[PHP]if(isset($_GET['buy']))</p><p> {</p><p> $re = "SELECT * FROM info_sell WHERE id='".$_GET['buy']."' AND added='".$row['username']."'";</p><p> $res = mysql_query($re) or die(mysql_error());</p><p> $buy = mysql_fetch_array($res);</p><p> $b = $row['credit'];</p><p> $s = $buy['price'];</p><p> if($b < $s)</p><p> {</p><p> echo '<font color="red">Cannot buy with '.$row["price"].'</font>';</p><p> }</p><p> if($b > $s)</p><p> {</p><p> echo '<h1>this work!</h1>';</p><p> }</p><p> }[/PHP]</p><p>so let me explain, the method $_GET['buy'] will listen for a url display like this: localhost/cart.php?buy=1 so we can know where they buying from and if the user added it. Afterwards, $row is a user data that isnt shown cause its in the function and its not the problem. But the if greater than or less than is a problem and i dont know how to continue from this mishaps. It doesnt show result if it works or cannot buy help?</p></blockquote><p></p>
[QUOTE="Li1M0ST3Rz, post: 374650, member: 1271"] [PHP]if(isset($_GET['buy'])) { $re = "SELECT * FROM info_sell WHERE id='".$_GET['buy']."' AND added='".$row['username']."'"; $res = mysql_query($re) or die(mysql_error()); $buy = mysql_fetch_array($res); $b = $row['credit']; $s = $buy['price']; if($b < $s) { echo '<font color="red">Cannot buy with '.$row["price"].'</font>'; } if($b > $s) { echo '<h1>this work!</h1>'; } }[/PHP] so let me explain, the method $_GET['buy'] will listen for a url display like this: localhost/cart.php?buy=1 so we can know where they buying from and if the user added it. Afterwards, $row is a user data that isnt shown cause its in the function and its not the problem. But the if greater than or less than is a problem and i dont know how to continue from this mishaps. It doesnt show result if it works or cannot buy help? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Purchase Script Mishaps
Top