PravinS
-
Posts
459 -
Joined
-
Last visited
-
Days Won
2
Posts posted by PravinS
-
-
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.
-
Try this
<?php $k = 1; while () // your while loop { // your code if ($k % 5 == 0) echo "<br>"; $k++; } ?>
-
Are you getting some error?
-
Use
this[this.selectedIndex].text
Instead of
this[this.selectedIndex].value
-
You can use this function
function force_download($file) { $dir = ""; if ((isset($file))&&(file_exists($dir.$file))) { header("Content-type: application/force-download"); header('Content-Disposition: inline; filename="' . $dir.$file . '"'); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($dir.$file)); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $file . '"'); readfile("$dir$file"); } }
-
Use SQL query like this.
SELECT * FROM tbl_name WHERE key_col LIKE 'RY%';
-
How will you get $row['id']?
-
Your delete query is wrong, you have used $ in where condition for field name. Use below given query.
$query = "DELETE FROM recipes WHERE id = '$id'";
-
While inserting data in the table use MYSQL NOW() function to insert date, and while retrieving it from database use MYSQL DATE_FORMAT() function.
-
Also add enctype="multipart/form-data" for form.
-
First echo is commented and second is blank.
-
What method you are using in form POST or GET?
-
You need to create database on new server and upload the database from old server. Create database dump(.sql) file from old server and upload it to new server. Then in cms_class.php page update username, password, database name of new server.
-
Does image.gif physically exists in images folder?
-
Use below given functions
function select_row($sql) { //echo $sql . "<br />"; if ($sql!="") { $result = mysql_query($sql) or die("Error: ".mysql_errno().":- ".mysql_error()); if ($result) { while($row = mysql_fetch_assoc($result)) $data[] = $row; } return $data; } } function pagingSlot($sql, $recperpage, $pagesetlimit, $page, $class, $getvars) { $rescnt=mysql_query($sql); $totcnt=mysql_num_rows($rescnt); if (!$page) $page = 1; $first=(($page-1)* $recperpage); $sql = $sql . " limit ".$first.",".$recperpage; $res = select_row($sql); $serial_no = ($page - 1) * $recperpage; $t = ($totcnt/$recperpage); $arr=split('[.]',$t); if ($arr[1]) $totalpages=$arr[0]+1; else $totalpages=$arr[0]; if ($totalpages > $pagesetlimit) { if ($page > 1) $pagesetstart = $page - 1; else $pagesetstart = $page; $pagesetend= ($pagesetstart-1) + $pagesetlimit; if ($pagesetend > $totalpages) { $pagesetend = $totalpages; $pagesetstart = $pagesetend - $pagesetlimit + 1; } } else { $pagesetstart = 1; $pagesetend = $totalpages; } $str = ""; if ($page > 1) { $prev = $page - 1; $str.= "<a href='".$_SERVER['PHP_SELF']."?page=$prev".$getvars."' class='".$class."'> << </a> | "; } else { $str.= "<< | "; } for ($i=$pagesetstart; $i<=$pagesetend; $i++) { if ($i <= $totalpages) { if (!$page) $page=1; if ($page==$i) $str.= '<font color=red>'.$i.'</font> '; else $str.= "<a href='".$_SERVER['PHP_SELF']."?page=$i".$getvars."' class='".$class."'>".$i."</a> "; } } if ($page < $totalpages) { $next = $page + 1; $str.= " | <a href='".$_SERVER['PHP_SELF']."?page=$next".$getvars."' class='".$class."'> >> </a> "; } else { $str.= " | >> "; } if ($totcnt == 0) $str = ""; $arr["records"]=$res; $arr["link"]=$str; $arr["serial"]=$serial_no; return $arr; }
-
Use like this
mysql_query("update application set comment='".mysql_real_escape_string($_POST[comment])."', userdatetime = NOW() where `IGN`='".mysql_real_escape_string($_POST[name])."'");
-
remove the (') single quotes, use only NOW() function.
Also why are you using 2 different queries to update same table. You can do it in single update query.
-
You have not used mysql_query() function for insert query
$sql= mysql_query("INSERT INTO application (datetime) VALUES (NOW())");
-
Hi
Please use below given function
function pagingPN($sql, $page, $limit, $getvars, $class) { if ($page == "") $page = 1; if ($limit == 0) $limit = $this->limit; $tsql = $sql; $result = mysql_query($tsql) or die("Error: ".mysql_errno().":- ".mysql_error()); $total = mysql_num_rows($result); $totnumpages = ceil($total/$limit); if ($offset < 0) $offset = 0; else $offset = ($page - 1) * $limit; $sql = $sql. " limit $offset, $limit"; if ($sql!="") { $result = mysql_query($sql) or die("Error: ".mysql_errno().":- ".mysql_error()); if ($result) { while($row = mysql_fetch_array($result)) $data[] = $row; } $res = $data; $serial_no = ($page - 1) * $limit; if ($total > 0) { $link .= "<font face='verdana' size='1'>Page: <strong>".$page."</strong> of <strong>".$totnumpages."</strong> Goto: </font>"; if ($page > 1) { $link .= "<a href=".$_SERVER['PHP_SELF']."?page=1$getvars class='".$class."' title='Jump to First Page'><<</a> | "; $prev = $page - 1; $link .= "<a href=".$_SERVER['PHP_SELF']."?page=".$prev."$getvars class='".$class."' title='Goto Previous Page'>Previous</a><span class='".$class."'> | </span>"; } else { $link .= "<span class='".$class."' title='Jump to First Page'><<</span> | <span class='".$class."' title='Goto Previous Page'>Previous | </span>"; } if ($page < $totnumpages) { $next = $page + 1; $link .= "<a href=".$_SERVER['PHP_SELF']."?page=".$next."$getvars class='".$class."' title='Goto Next Page'>Next</a> | "; $link .= "<a href=".$_SERVER['PHP_SELF']."?page=".$totnumpages."$getvars class='".$class."' title='Jump to Last Page'>>></a>"; } else { $link .= "<span class='".$class."' title='Goto Next Page'>Next</span> | <span class='".$class."' title='Jump to Last Page'>>></span>"; } } $retarr["sql"] = $sql; $retarr["records"] = $res; $retarr["serial_no"] = $_no; $retarr["link"] = $link; return $retarr; } } $rs = pagingPN($query, trim($_REQUEST['page']), 10, "", "pagingCSS"); $rs_recordset = $rs['records']; $link = $rs['link'];
-
Oh I am really sorry
Date doesn't display :(
in PHP Coding Help
Posted
Try this
If "date" is you field name then it should work.