Load 100 MYSQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Load 100 MYSQL

    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.

    Code:
    	$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>
         &rarr;  <a href=\"./comments.php?id=$item[0]&amp;sid=$sid&amp;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.





    #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
    ------------------

    Comment


      #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.




      Comment


        #4
        "approved" isnt told which table to select it from on this line:
        PHP Code:
        $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."'")); 

        Comment


          #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
          ------------------

          Comment


            #6
            Originally posted by spiderwebs View Post
            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.




            Comment


              #7
              Originally posted by crazybrumi View Post
              always making stupid mistakes like that and sql didnt even pick the error up with the 5 mins debug i ran this morning

              Code:
              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
              ------------------

              Comment


                #8
                having fixed error at top still facing same issues i dont understand it
                Want something coded email me at sales@webnwaphost.com for a prices.




                Comment


                  #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...
                  _______
                  Info & Tips
                  php.net
                  w3schools.com

                  Comment

                  Working...
                  X