zrueda Posted August 17, 2009 Share Posted August 17, 2009 Ok I have had this problem all day with mysql for my Admin Panel. I get this error. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/bortix/public_html/lockerzinv.com/admin/index.php on line 93 This is the php. Code I will mark which is line 93. With 93. If you solve this I will reward. <?php $con = mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("database", $con) or die(mysql_error()); if ($_POST['newurl'] != '') { $url = $_POST['url']; mysql_query("INSERT INTO urls (url) VALUES ('$url')"); $new_url = true; } else if ($_GET['delete'] != "") { $del = $_GET['delete']; mysql_query("DELETE FROM urls WHERE id='$del'"); $url_delete = true; } ?> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="../main.css" /> <title>Lockerz Invites - Admin Panel</title> </head> <body> <center> <? if ($add_new) { echo '<div class="success"><center>New URL added successfully!</center></div>'; } ?> <? if ($url_delete) { echo '<div class="success"><center>URL Deleted successfully!</center></div>'; } ?> <form name="addurl" action="" method="post"> <input type="hidden" name="newurl" value="1"> <table class='alternate'> <tr bgcolor="b96e00"> <td><font color="ffffff"><center>URL</center></font></td><td></td> </tr> <tr bgcolor="555555"> <td><center><input type="text" name="url" value="" maxlength="1024" size="90%"></center></td> <td><center><input type="submit" value="Add"></center></td> </tr> </table> </form> <br> <table class='alternate'> <tr bgcolor="b96e00"> <td><font color="ffffff"><center>URL List</center></font></td><td></td> </tr> <? $searchresult = mysql_query("SELECT * FROM urls"); while($row = mysql_fetch_array($searchresult)); { echo '<tr bgcolor="555555">'; echo '<td><center><input type="text" name="url" value="' . $row['url'] . '" readonly></center></td>'; echo '<td><center><input type="button" value="Delete" onclick="window.location.href=\'index.php?delete=' . $row['id'] . '\'" alt="Delete"></center></td></tr>'; } ?> </table> </center> </body> </html> Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/ Share on other sites More sharing options...
onedumbcoder Posted August 17, 2009 Share Posted August 17, 2009 remove it and add this <?php $result = mysql_query("SELECT id, url FROM urls") or die(mysql_error()); while($row= mysql_fetch_array($result)) { echo '<tr bgcolor="555555">'; echo '<td><center><input type="text" name="url" value="' . $row['url'] . '" readonly></center></td>'; echo '<td><center><input type="button" value="Delete" onclick="window.location.href=\'index.php?delete=' . $row['id'] . '\'" alt="Delete"></center></td></tr>'; } ?> Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899758 Share on other sites More sharing options...
zrueda Posted August 17, 2009 Author Share Posted August 17, 2009 Ok now it says. Table 'bortix_lockerzinv.urls' doesn't exist Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899762 Share on other sites More sharing options...
DavidAM Posted August 17, 2009 Share Posted August 17, 2009 That would mean there is no table named 'urls' in the 'bortix_lockerzinv' database. Is that the correct database? Does the table exist? Check the case, 'urls' might not be the same as 'URLS' depending on the configuration. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899764 Share on other sites More sharing options...
zrueda Posted August 17, 2009 Author Share Posted August 17, 2009 That would mean there is no table named 'urls' in the 'bortix_lockerzinv' database. Is that the correct database? Does the table exist? Check the case, 'urls' might not be the same as 'URLS' depending on the configuration. It must not be in the database. Thanks! Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899765 Share on other sites More sharing options...
onedumbcoder Posted August 17, 2009 Share Posted August 17, 2009 wait where is my money though? Im going to get paid right? Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899766 Share on other sites More sharing options...
zrueda Posted August 17, 2009 Author Share Posted August 17, 2009 wait where is my money though? Im going to get paid right? It was a simple fix. Thanks for your time. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899767 Share on other sites More sharing options...
zrueda Posted August 17, 2009 Author Share Posted August 17, 2009 Wait how do I put a table in my database? Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899768 Share on other sites More sharing options...
DavidAM Posted August 17, 2009 Share Posted August 17, 2009 He stiffed us on the first question, and now he's asking another? What? Do we get double-or-nothing for this one? Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899772 Share on other sites More sharing options...
onedumbcoder Posted August 17, 2009 Share Posted August 17, 2009 your lame ass should be banned. Please don't help zrueda if you value the integrity of our community, the man is a disgraceful lying individual. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899802 Share on other sites More sharing options...
.josh Posted August 17, 2009 Share Posted August 17, 2009 wait where is my money though? Im going to get paid right? It was a simple fix. Thanks for your time. ... Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-899999 Share on other sites More sharing options...
onedumbcoder Posted August 17, 2009 Share Posted August 17, 2009 Crayon can you please ban him (via ips associated with his account), he brings nothing but smear and indecency to these threads. I would have helped regardless, it is not about the money, but rather the false proposition made. I bet he never had any intentions of following through, what is more disturbing is that he did this with the intention and foreknowledge that it would steal attention/aid from ALL other members and focus it all on his issue. Done so maliciously, selfishly and intentionally. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-900508 Share on other sites More sharing options...
TGWSE_GY Posted August 17, 2009 Share Posted August 17, 2009 We are a willingly helpful community of coders, and to offer to pay is almost an insult to what we do here at PHPPhreaks, not to mention to offer to pay and then not, how unrespectable! I agree with onedumbcoder. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-900513 Share on other sites More sharing options...
.josh Posted August 17, 2009 Share Posted August 17, 2009 I'm not defending the OP, but I really don't understand why you are so upset. Technically, he could paypal you $0.01 and fulfill his end of the bargain. Even more technically, "willing to pay" does not mean "will" pay, nor does it mean what will be paid. Same goes for "reward." He promised a reward, but did not mention what that reward would be. Instead of asking for details or securing anything with him, you jumped right in and helped. He could technically fulfill his end of the bargain by forking over a penny or just saying "Thanks!" ("Thanks" can be a payment, and it can also be a reward). You are obviously not happy with him saying "Thanks!" Would you have been happy if he paypaled you $0.01? I have a sneaking suspicion you would have been bitching just the same. But for what? As mentioned, you guys came to no official, or even unofficial agreement on anything. Again, I'm not defending the OP. But I put this in the same category as people who purposely post in higher volume forums to get a quicker answer, or post in multiple forums, or bump every 2 seconds. I think instead of you getting upset at him about it and demanding vengeance, you should chalk it up as a lesson learned, laugh about it, and get over it. Sorry, but that's just the way it is. Link to comment https://forums.phpfreaks.com/topic/170579-need-help-quick-willing-to-pay/#findComment-900516 Share on other sites More sharing options...
Recommended Posts