Load 100 MYSQL

Started on the old forum in September 2012 · view the original in the archive · old links redirect here

8 replies · 632 views · started 14 years ago · 1 min read

4 participants
crazybrumi Super moderator Principal · 1,064 posts #1

hi guys, having a bit of troule regarding load. is there any debug for php that could maybe step in when it doesnt like something like vb.

heres there code any ideas would be appreciated.

	$sex='m';
	if($page=="" || $page<=0)$page=1;
	$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM my_gallery a INNER JOIN profiles b ON a.uid=b.uid WHERE approved=1 AND b.sex='".$sex."'"));
	$num_items = $noi[0]; 
	$items_per_page= 4;
        $num_pages = ceil($num_items/$items_per_page);
	if(($page>$num_pages)&&$page!=1)$page= $num_pages;$limit_start = ($page-1)*$items_per_page;
	 
  
     $items=mysql_query("SELECT a.id, a.path, b.sex FROM my_gallery a INNER JOIN 
     profiles b ON a.uid=b.uid WHERE a.approved=1 AND b.sex='".$sex."'
     ORDER BY a.id DESC LIMIT $limit_start, $items_per_page");

    if(mysql_num_rows($items)>0)
    while ($item = mysql_fetch_array($items)){
    $filename=explode(".",$item[1]);
    $nick1=explode("/",$item[1]);
    $nick=explode("(",$nick1[5]);

     echo"<p align=".align()."><img src=\"$item[1]\" width=\"150\" height=\"150\" alt=\"$item[0]\"/></br>
     →  <a href=\"./comments.php?id=$item[0]&sid=$sid&who=$who\">Photo Comments</a></p>";
     }else{
    echo"<p align=".align().">There Are No Gallery Pics Atm...</p>";
    }

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

spiderwebs Developer · 193 posts #2

your problem not seems any php debug problem could your more specific with your error? you can use DevZone to debug

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

crazybrumi Super moderator Principal · 1,064 posts #3

in terms of the output its is as i want it, however the performance side lets it down, loading 5 images can take 15 seconds or even more that's if it loads, if it doesn't load it will just send MySQL insane to the point i need to restart the service or kill the process.

thanks for the software, il give that a go, hopefully will be able to fix it tonight.

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

something else Fellow · 2,296 posts #4

"approved" isnt told which table to select it from on this line:

$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM my_gallery a INNER JOIN profiles b ON a.uid=b.uid WHERE approved=1 AND b.sex='".$sex."'"));
spiderwebs Developer · 193 posts #5

check your sql codes it having error which not selecting exact value as Something_Else has just pointed out thats why it keep on loading

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

crazybrumi Super moderator Principal · 1,064 posts #6

spiderwebs wrote: check your sql codes it having error which not selecting exact value as Something_Else has just pointed out thats why it keep on loading

always making stupid mistakes like that and sql didnt even pick the error up with the 5 mins debug i ran this morning

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

spiderwebs Developer · 193 posts #7

crazybrumi wrote: always making stupid mistakes like that and sql didnt even pick the error up with the 5 mins debug i ran this morning

SELECT * FROM `table` my_gallery
INNER JOIN `profiles` b
ON a.`id`=b.`id`
WHERE b.`approved` = "1"

hope this will fix your error 🙂

E107 Security Team Leader Proudly Support AccountLab Plus Billing Software

Want your Apps to be Developed ??? mail us your requirement at info@csarlab.com

subzero Super moderator Fellow · 3,954 posts #9

Name to name, next name, will deflag your Mysql 😉 using that ...

You can zip database to smaller

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close