•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,558 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,562 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 543 | Replies: 4 | Solved
![]() |
•
•
Join Date: Jan 2006
Posts: 3
Reputation:
Rep Power: 0
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.
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
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
while( $row = mysql_fetch_assoc( $query ) ) {i am compleatly lost. i have no idea what so ever is wrong.
•
•
Join Date: Jun 2007
Location: Tuticorin,tamilnadu
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
Join Date: Jan 2006
Posts: 3
Reputation:
Rep Power: 0
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Removing Query Strings (ASP.NET)
- Double MySQL Query (PHP)
- Dynamic Query (JSP)
- Retreiving variables from a sql query into a form (PHP)
- Sql Query (VB.NET)
- 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


Linear Mode