| | |
dosent like query
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
•
•
Join Date: Jan 2006
Posts: 3
Reputation:
Solved Threads: 0
well here is the part of my script that is malfuctioning.
i get thsi error
and from the code above this is the line it is refering to
i am compleatly lost. i have no idea what so ever is wrong.
PHP Syntax (Toggle Plain Text)
require "config2.php"; require "config.php"; $result = mysql_query( "SELECT `sum` FROM `subs`" ); $sq = mysql_fetch_assoc($result); $value = $sq['sum']; $val = preg_replace('/$/', '', $value); ?> <br> <?php echo $val; $query = mysql_query( "SELECT title, threadid FROM `thread` WHERE forumid = '10' ORDER BY threadid LIMIT '". $val ."' , 10" ); while( $row = mysql_fetch_assoc( $query ) ) { ?>
i get thsi error
PHP Syntax (Toggle Plain Text)
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in
and from the code above this is the line it is refering to
PHP Syntax (Toggle Plain Text)
while( $row = mysql_fetch_assoc( $query ) ) {
i am compleatly lost. i have no idea what so ever is wrong.
•
•
Join Date: Jan 2006
Posts: 3
Reputation:
Solved Threads: 0
i found the problem. because like all good problems 2 mins after you post it you solve it yourself.
it was the config files. they contain conecxtion deatils for two diffrent dbs and if you look were they are you can see that it will run my secound query of the file config file not the secound like i wanted.
it was the config files. they contain conecxtion deatils for two diffrent dbs and if you look were they are you can see that it will run my secound query of the file config file not the secound like i wanted.
![]() |
Similar Threads
- Sql Query (VB.NET)
- Removing Query Strings (ASP.NET)
- Double MySQL Query (PHP)
- Dynamic Query (JSP)
- Retreiving variables from a sql query into a form (PHP)
- Query Building (Database Design)
Other Threads in the PHP Forum
- Previous Thread: Returning HTML code through SQL query?
- Next Thread: exec function on Windows XP
| Thread Tools | Search this Thread |
apache api array autocomplete beginner binary body broken cakephp class cms code cron curl database dataentry date date/time display duplicates dynamic ebooks email emptydisplayvalue error execute explodefunction file firstoptioninphpdroplist folder form forms function functions google href htaccess html image include ip javasciptvalidation javascript joomla keywords limit link list login matching mediawiki menu msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue query random recourse recursive regex script search seo server sessions shot source sp space speed sql static subdomain subscription system table tag tutorial tutorials update upload url validator variable vbulletin video web webdesign white xml youtube





