Jump to content

PravinS

Members
  • Posts

    459
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by PravinS

  1. Use this function function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; }
  2. You can you date function with hour/minute/second as first parameter and the timestamp value as second parameter
  3. You can also convert date into timestamp using mktime() function and use it in loop.
  4. Alert the "result" and check what you are getting.
  5. May this will help you, its a simple dynamic multilevel menu https://sourceforge.net/projects/multilevelmenu/files/latest/
  6. You mean to add text box to edit in combo box?
  7. Also if you want to display any other text from table then you need to add field name in query and you drop down will be like this. while ($row=mysql_fetch_array($result)) { echo '<option value="'.$row['supp_id'].'">'.$row['TXTFIELD'].'</option>\n'; } check the TXTFIELD in drop down, just replace your field name there
  8. Replace the while loop while ($row=mysql_fetch_array($result)) { echo '<option value="'.$row['supp_id'].'">'.$row['supp_id'].'</option>\n'; }
  9. Try this function function sort_array($array, $key, $order) { if ($order=="DESC") $or="arsort"; else $or="asort"; for ($i = 0; $i < sizeof($array); $i++) { $sort_values[$i] = $array[$i][$key]; } $or($sort_values); reset ($sort_values); while (list ($arr_key, $arr_val) = each ($sort_values)) { $sorted_arr[] = $array[$arr_key]; } return $sorted_arr; }
  10. Give name to submit button and write your search code in isset of submit button. <form method="get"> <input type="text" name="search" value="<?php echo $search; ?>"> <input type="submit" value="Search" name="btnSubmit"> </form> <?php if (isset($_POST['btnSubmit'])) { //you search code } ?>
  11. Use like this <a href="#"><img src="" border="0"></a>
  12. Ok, I have attached the zip file [attachment deleted by admin]
  13. You can download this simple PHP/MYSQL/JAVASCRIPT menu designed by me from below given link. It is freeware. https://sourceforge.net/projects/multilevelmenu/files/latest/
  14. PravinS

    mysql date

    If data type of the date field is DATE or DATETIME then you can use DATE_FORMAT(date,format) function in your select query.
  15. You can use this function function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; }
  16. If the session variable "area" is blank then that option will be selected.
  17. Check the % character, it should be in single quotes $sql = SELECT * FROM articlessection where 1 and ArticlesSection_Name LIKE '%ar%' and Language_ID =2 Order by ArticlesSection_Order ASC
  18. May this will help you. It will give you complete folder path. You can explode it with "/" character and take the last value of array for current folder name. $dir = dirname($_SERVER['REQUEST_URI']);
  19. Try this <?PHP $res = mysql_query("SELECT id, DATE_FORMAT(date, '%S %D %Y') as dt, firstname, lastname, testimonial FROM testimonials ORDER BY date DESC LIMIT 10"); while ($row = mysql_fetch_assoc($res)) { echo "<b>{$row['firstname']} {$row['lastname']}</b><br />on {$row['dt']}<br />{$row['testimonial']}<br /><br />"; } ?> If "date" is you field name then it should work.
  20. Use like this echo '<a href="http://www.dhcottages.co.uk/testsite/admin/clients/addClients.php?id='.$id.'">Client allready exists click here to view and change client details.</a>';
  21. Use preg_split() function <?php $string = 'Sam Neill|William H. Macy|Tea Leoni|'; $keywords = preg_split("/[|$*]+/", $string); print_r($keywords); ?>
  22. Use explode() function to separate.
  23. You can use javascript validation
  24. You can change your table structure as told by "laffin" and then you can use recursive function to retrieve the subcategories.
×
×
  • 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.