Jump to content

Dathremar

Members
  • Posts

    169
  • Joined

  • Last visited

Everything posted by Dathremar

  1. Your query is broken. Use ' around your variables and also try addslashes() to escape illegal chars before inserting into DB
  2. Try changing this $_FILES["img$imgNumb"][name] to $_FILES['img$imgNumb'][name] in the do while loop and everywhere You use that. Also if that does not work try $_FILES["img".$imgNumb][name]
  3. Does this script work ? Cuz I see the action of the form empty.
  4. 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
  5. well Your submit button is named "Submit" and not "submit"
  6. echo "<img src='".$avatar_path. $avatar_name ."'>"; in the src You need to give the exact location of the picture that needs to be displayed.
  7. echo "<img src='".$avatar_path."'>";
  8. I failed there :S Sorry, lack of info, thought it could be done with ini_set... my bad
  9. 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
  10. Why is it hard to format them as you want to? Can You give me more of the code, to try to format the output.
  11. Well then something like this: for ($i=0; $i < count($array1); $i++) { echo "<tr><td>".$array1[$i]."</td><td>".$array2[$i]."</td></tr>"; } That should give You separate row with the info image / text. You may echo it in any style ofc
  12. Well does this mean that both arrays have same amount of elements?
  13. 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
  14. Well If You know how to get the info out of the database, then like You said simply add as many dots/bars to the html. Then ofc use css to make them to look as you like. For the SQL part use the count() function to count the number of hits in the db, so you wont have to loop through a whole bunch of results, but just You will get one row of data.
  15. echo "<tr class='" . $class . "' ><td>";
  16. 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
  17. It is the same thing again. You tend to use singe quotes inside a quoted statement. If You quote something with ' then all the ' used inside should be escaped, like Russel said. So put \ in front of the ' that are inside you command.
  18. just use: "INSERT INTO table_name ( column1, column2, column3 ) VALUES ( 'value1', 'value2', now() )"; read this time and date functions
  19. $result = mysql_query($query) or die(mysql_error()); print that please
  20. There is a print_r function in php, but I doubt You will want that kind of output But You can always do something like: for ($i=0; $i < count($table_list); $i++) { echo $table_list[$i]; }
  21. This query "SELECT COUNT(*) FROM `$table` WHERE `site` LIKE '$entry'" will always have only one record which will contain the number of matches.
  22. 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.
  23. 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.