Pentiums Posted April 15, 2009 Report Posted April 15, 2009 (edited) Labvakar. Problēmiņa ar PHP fju mysql_num_rows. Met ārā: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/index.php on line 31 Kods te: $query = mysql_query("SELECT * FROM invites WHERE id = 1 AND to = 1 AND from = 9"); if(mysql_num_rows($query) != 0) { ... } DB tabula te: CREATE TABLE `invites` ( `id` int(11) NOT NULL auto_increment, `to` int(11) NOT NULL, `from` int(11) NOT NULL, `date` varchar(10) collate utf8_latvian_ci NOT NULL, `text` text collate utf8_latvian_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_latvian_ci; Edited April 15, 2009 by Pentiums Quote
Klez Posted April 15, 2009 Report Posted April 15, 2009 (edited) $query = mysql_query("SELECT * FROM invites WHERE id = 1 AND to = 1 AND from = 9") or die(mysql_error()); es parasti rakstu if(mysql_num_rows($query) > 0) bet tas buutiibu nemaina if(mysql_num_rows($query) != 0) { ... } Edited April 15, 2009 by Klez Quote
Grey_Wolf Posted April 15, 2009 Report Posted April 15, 2009 pamegjini to kveriju iebarot Pa taisno DB ( caur consoli vai PhpMyAdmin ).. tad redzeesi kas un kaa.. Bet vispar labaak atteikties no taadiem lauku nosaukumiem kaa TO FROM IF utt .. iespejams kaa tieshi taa ir problema ... -> pamegjini vinjus (lauku nosaukumus ielikt starp ( ` ) ... Quote
Pentiums Posted April 15, 2009 Author Report Posted April 15, 2009 jā, kur nu es neiedomājos, ieliku starp ` sanāca :D Paldies! :) Quote
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.