Jump to content

Dathremar

Members
  • Posts

    169
  • Joined

  • Last visited

Posts posted by Dathremar

  1. I think You should change

     

    for ($i=0; $i<= $b; $i++)
             {
                if ($a[$i] == $cat['id'])
                {
                   $checked .= 'checked="checked"';
                }   
             }
    

     

    To:

     

    $checked = (in_array($cat['id'] ), $a) ? 'checked="checked"' : "";       
    

     

    The statement $checked .= 'something' concats the string to the already existing $checked variable. Probably that is why You got all the check boxes checked.

     

    Hope this helps

  2. Ok so even though I still don't get why You can't loop echo them out in a table, I would recommend joining the 2 arrays into one 2 dimensional array ie.

    $array3 = array_combine($array1, $array2);
    
    foreach ($array3 as $img => $desc)
    {
    echo "<tr><td>".$img ."</td><td>".$desc."</td></tr>"; // or any other format ir div, span or w/e
    }
    

    Hope it helps

  3.  

    if($_POST['shout'] == "Shout"){
      $to = $_POST['to'];
      $from = $_POST['from'];
      $message = $_POST['message'];
    
          $messagesql              = $op->insert("INSERT INTO ".tbl_message." (toid,fromid,message,date) VALUES ('".$to."','".$from."','".$message."','".date('Y-m-d:h:i')."')");
    
    	       if($messagesql > 0){
                             // add mail function here
    	 	 $err_msg_shout="Shout Posted: ".$message; // displaying the message
                      else{
    	             $err_msg_shout="Error, Try Again";
                          }
    }}

     

    and for sending mail use mail() function.

     

     

  4. Ok if theres 10 ppl and 7 say yes and 3 say no - what percentage says yes

     

    Answer : 23%

     

    That doesn't make any sense.

     

    But if You want to make a percentage of something you need to know whats the max ie.

     

    10 ppl

    7 say yes

    3 say no

     

    so 7*1/10 = 0.7 * 100 = 70% yes ppl

    3 * 1 / 10 = 0.3 * 100 = 30% no ppl

     

    ie2.

    1230 ppl and 14 say yes and 1216

     

    1216*100 * 1/1230 = yes percentage

    14 *100 1/1230 = no percentage

     

    Hope you understand this

  5. try this:

     

    'text'  => '<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf(\'opera\') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open(\'/webim/client.php?locale=en&url=\'+escape(document.location.href)+\'&referrer=\'+escape(document.referrer), \'webim\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="163" height="61" alt=""/></a><!-- / webim button -->'

                                  );

     

    And can You tell us what the error says?

    Install FireBug in Firefox it helps for solving errors ;)

  6. Is this search button  only for mobile phones?

     

    If yes, split the search field into two fields and mark them manufacturer and model so then we can know which words to get priority in the search.

     

    If no, then I will tell You again that the thing You want to be done is not really easy to do as a matter of fact with the table You have not sure if You can do it at all without making a lot of queries and php mathematics which will really burden your server.

  7. Hello again :)

     

    Yes You can check for words that have integer values in them and run the query with them, but again what if user enters for instance:

    Nokia n97 6100,

    then we get search words: Nokia; n97; 6100

    We make the query like:

     

    (SELECT fileds_to_select, red 1 FROM product_table WHERE ( (product_name LIKE '%n97%') OR ( product_name LIKE '%6100%') ) )

    UNION

    (SELECT fileds_to_select, red 2 FROM product_table WHERE ( (product_name LIKE '%Nokia%') ) )

    ORDER BY red

     

    The result will have 2 rows for the 1st query and ie. 10 rows for second:

    Again we have problem cuz the Nokia 6100 may be the 1st result and then Nokia n97 ...

     

    It will be more accurate, but not sure if this satisfy Your needs

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.