Snaip3Rs Posted October 6, 2009 Report Share Posted October 6, 2009 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in C:\hack\AppServ\www\shops\smscw.php on line 82 <html> <head> <!-- right click start --> <script> var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function mischandler(){ return false; } function mousehandler(e){ var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false; } document.oncontextmenu = mischandler; document.onmousedown = mousehandler; document.onmouseup = mousehandler; </script> <!-- right click end --> <style type="text/css"> body { font-family: Tahoma, "Lucida Grande", 'Trebuchet MS', verdana, arial, sans-serif; font-size: 12px;background-color:#C0C0C0; } img { border: 0; } table { text-align: left; } a:visited { color: #FFSDFG; } input { margin-left: 5px; margin-top: 3px; margin-bottom: 3px; background: url(images/inpbg.jpg); border: 0; padding: 2px; border: 1px solid #b6b6b6; font-size: 10px; } </style> <title>SHOP!</title> <link rel="stylesheet" href="styles.css" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <style type="text/css"> body { font-family: Tahoma, "Lucida Grande", 'Trebuchet MS', verdana, arial, sans-serif; font-size: 12px;background-color:#C0C0C0; } img { border: 0; } table { text-align: left; } a:visited { color: #2291FF; } input { margin-left: 5px; margin-top: 3px; margin-bottom: 3px; background: url(images/inpbg.jpg); border: 0; padding: 2px; border: 1px solid #b6b6b6; font-size: 10px; } </style> <br> <? if(isset($_POST['prece'])) { if ($_POST['prece'] == '1') { $links = './dooring/playline_web_lietas.zip'; } elseif ($_POST['prece'] == '2') { $links = '/shops/dooring/mape.rar'; } elseif ($_POST['prece'] == '3') { $links = '/SHOP/dooring/unban.rar'; } elseif ($_POST['prece'] == '4') { $links = '/SHOP/dooring/nick.rar'; } } elseif ($_POST['prece'] == '5') { $links = '/dooring/unban.rar'; } elseif ($_POST['prece'] == '6') { $links = '/dooring/nick.rar'; } $code = $_POST["kods"]; $price = 'cena'; //izvelas kodu datubazi, lai parbauditu, vai kods ir derigs $con = mysql_connect("localhost","root","1991jz9969470"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("db", $con); if (!$db_selected) { die (mysql_error()); } //parbauda vai der if(mysql_result(mysql_query("SELECT COUNT(*) FROM code WHERE code = '$code'"),0,'COUNT(*)') > 0){ echo "<b><body background-color:#C0C0C0><br>Kods ir derigs lejupladet vari te. <a href='$links'>?eit</a>!"; } else{ echo "<script>alert('Nepareizs kods!');window.back()</script>"; unset($code); exit(); } $delete = "DELETE FROM code WHERE code = '$code'"; mysql_query($delete) or die(mysql_error()); mysql_close(); ?> Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted October 6, 2009 Report Share Posted October 6, 2009 Nu acīmredzot 82. rindiņā esošais mysql_query() neizveido PHPprāt derīgu mysql rezultātu. Meklē problēmu vaicājumā, vai tiešām visi iesaistītie parametri tiek padoti utt. utjp. Quote Link to comment Share on other sites More sharing options...
xmas12 Posted October 6, 2009 Report Share Posted October 6, 2009 sākumā $db_selected = mysql_select_db("db", $con); seit kur ir "db" tur ieliec datubazi kur tev viss glabaajas,otra izveido datubazee fieldu code un id , id liec autoacigrment un trešais 82 rindiņu ieleic šādu! if(mysql_result(mysql_query("SELECT COUNT(*) FROM code WHERE code = '$code'"),0,'COUNT(*)') > 0){ vajdzētu strādāt tagad gan! Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted October 7, 2009 Author Report Share Posted October 7, 2009 nestrādā! to pašu error met virsū! Quote Link to comment Share on other sites More sharing options...
xmas12 Posted October 7, 2009 Report Share Posted October 7, 2009 pag, iedosu visu to smscw failu. reku ieleic sito tikai saliec konektaaciju mysql kaa tev vajag: http://paste.php.lv/74bb14f9d55a9971cdccdc99c5ed47a8?lang=php un to ko tev vajag mainit tad šeit: //izvelas kodu datubazi, lai parbauditu, vai kods ir derigs $con = mysql_connect("localhost","tavs niks","tava parole"); if (!$con) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db("code", $con); ieadi tur kur ie localhost tur atstaaj ja tu testee uz pc, tur kur ir tavs niks tur ganjau root, paroli liec mysql paroli un lejaa $db_selected = mysql_select_db("code", $con); kur ir "code" tur liec datubaaz. ja strādā tad uzraksti, ja ne tad meiginaasu palidzet kkadiigi . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.