![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | ||
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
![]() Could one of the programming types give me a hand with this error that i am getting running a script on my server...
Quote:
Quote:
174 & 175 line: Code:
$query="SELECT COUNT(*) FROM $table_name"; list($total_links)=mysql_fetch_array(mysql_query($query)); Code:
$i=0; $res=mysql_query($query); echo "<td>"; while($r=mysql_fetch_array($res)) { $i++; $id=$r['id']; $dir_name=$r['dir_name']; $thumb=displayThumb($dir_name,$r['thumb']); ![]() |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
$table_name is not defined, or that table doesn't exist at all, or is perhaps corrupted... or perhaps you have wrong db credentials in your config file...
if you want me to take a closer look for a few bucks, icq: 33375924 or woj#at#wojfun#.#com
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Posts: 574
|
Try backing up and restoring the database tables again. Also note that 'warning' messages can be turned off in PHP configuration (debug mode), they are not errors which will halt your script.
__________________
![]() █ ► XenLayer - Paravirtualization Professionals since 2008 - [ICQ: 297820698] █ ► Reseller Hosting | OpenVZ VPS | XEN VPS | Dedicated Servers |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
I just repaired the SQL table and that seems to have fixed it for a few minutes.
Im now thinking there is an issue with my hosting companies SQL system perhaps? Every time i run the program, if i 'repair' the table afterwards it works again. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Posts: 574
|
At those lines the warning appears, change mysql_fetch_array to @mysql_fetch_array
It will make it silent.
__________________
![]() █ ► XenLayer - Paravirtualization Professionals since 2008 - [ICQ: 297820698] █ ► Reseller Hosting | OpenVZ VPS | XEN VPS | Dedicated Servers |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: May 2012
Posts: 124
|
Quote:
what good is making it silent if he needs for debugging assuming its not a live site and if it is a live site then set display_errors off in php config and then check error log, but add some code to handle that issue checking the result var Also you should move away from mysql library at the very least use mysqli. The Mysql lib will be deprecated in php's future and its an old library that lacks support in many things |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
So Fucking Banned
Join Date: Sep 2003
Posts: 1,360
|
Well after getting on the phone with the host, it appears the error was with them blocking the server IP address from writing to SQL.
No idea how or why this happened, but the problem is now fixed and the script is working as it should be. Thanks all for the assistance with this issue, its appreciated ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
You need to CAST the count to a named variable...
Code:
$query="SELECT COUNT(*) AS numrows FROM $table_name"; $ret = mysql_query($query); $fetched = mysql_fetch_array($ret); echo 'Amount = '.$fetched['numrows']; ![]() ...glad you got it sorted out.
__________________
The Best Affiliate Software, Ever. |
![]() |
![]() ![]() ![]() ![]() ![]() |