![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
PravinS
-
Posts
459 -
Joined
-
Last visited
-
Days Won
2
Posts posted by PravinS
-
-
You can you date function with hour/minute/second as first parameter and the timestamp value as second parameter
-
You can also convert date into timestamp using mktime() function and use it in loop.
-
Alert the "result" and check what you are getting.
-
May this will help you, its a simple dynamic multilevel menu
https://sourceforge.net/projects/multilevelmenu/files/latest/
-
You mean to add text box to edit in combo box?
-
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
-
Replace the while loop
while ($row=mysql_fetch_array($result)) { echo '<option value="'.$row['supp_id'].'">'.$row['supp_id'].'</option>\n'; }
-
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; }
-
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 } ?>
-
Use like this
<a href="#"><img src="" border="0"></a>
-
Ok, I have attached the zip file
[attachment deleted by admin]
-
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/
-
If data type of the date field is DATE or DATETIME then you can use DATE_FORMAT(date,format) function in your select query.
-
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; }
-
If the session variable "area" is blank then that option will be selected.
-
What PHP version you are using?
-
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
-
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']);
-
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.
-
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>';
-
Use preg_split() function
<?php $string = 'Sam Neill|William H. Macy|Tea Leoni|'; $keywords = preg_split("/[|$*]+/", $string); print_r($keywords); ?>
-
Use explode() function to separate.
-
You can use javascript validation
-
You can change your table structure as told by "laffin" and then you can use recursive function to retrieve the subcategories.
mysql_real_escape string or htmlspecialchars, etc. what to use?
in PHP Coding Help
Posted
Use this function