
jugesh
Members-
Posts
38 -
Joined
-
Last visited
Everything posted by jugesh
-
Mysql takes date as YYYY-MM-DD format, If your date column is Date type If you want to insert date in date("m.d.y") format make date column as varchar
-
I am having a problem sending info to a database
jugesh replied to nikhilsnehilster's topic in PHP Coding Help
post your code -
Hi mdemetri2, It has nothing to do with HTTPS... you can write the sql to generate data and put it in adRow function eg: $csv = new CSV(array('Col1', 'Col2',......)); while($row=mysql_fetch_array($res)){ $csv->addRow(array($row["Col1"], $row["Col2"])); }
-
I am having a problem sending info to a database
jugesh replied to nikhilsnehilster's topic in PHP Coding Help
Your question is somewhat confusing for me... Do u want to save the values in DB? -
how to save image in database using div tag
jugesh replied to nikhilsnehilster's topic in PHP Coding Help
$div = mysql_real_escape_string($_POST['contents']); // Make sure to clean the // data before putting SQL $sql = "INSERT INTO divs (contents) VALUES ('{$div}')"; -
here is a class to create CSV class CSV { protected $data; /* * @params array $columns * @returns void */ public function __construct($columns) { $this->data = '"' . implode('","', $columns) . '"' . "\n"; } /* * @params array $row * @returns void */ public function addRow($row) { $this->data .= '"' . implode('","', $row) . '"' . "\n"; } /* * @returns void */ public function export($filename) { header('Content-type: application/csv'); header('Content-Disposition: attachment; filename="' . $filename . '.csv"'); echo $this->data; die(); } public function __toString() { return $this->data; } } $csv = new CSV(array('Col1', 'Col2',......)); $csv->addRow(array('Val1', 'Val2',...));
-
end of every statement check ; is there or not?
-
create a php file and write the command: <? echo phpinfo()?> upload file on server and run the file to check php settings to get the path
-
Can someone please tell me why my edit code aint working...
jugesh replied to Tunavis's topic in PHP Coding Help
You Query: $u = "UPDATE player_registration SET `name`='$_POST[inputname], `surname`='$_POST[inputsurname], `contact_number`='$_POST[inputcontact]', `email`='$_POST[inputemail]', `position`='$_POST[inputpos]', `username`='$_POST[inputusername]', `password`='$_POST[inputpassw]' WHERE ID = $_POST[player_id]"; mysql_query($u) or die (mysql_error()); check colored part one quote is missing. rectify it to: $u = "UPDATE `player_registration` SET `name`='$_POST[inputname], `surname`='$_POST[inputsurname]', `contact_number`='$_POST[inputcontact]', `email`='$_POST[inputemail]', `position`='$_POST[inputpos]', `username`='$_POST[inputusername]', `password`='$_POST[inputpassw]' WHERE ID = $_POST[player_id]"; mysql_query($u) or die (mysql_error()); -
Can someone please tell me why my edit code aint working...
jugesh replied to Tunavis's topic in PHP Coding Help
echo query and run query in phpmyadmin u wl come to know if there is any error -
$sql="SELECT * FROM users Where userid ! ='your_user_id' ORDER BY username";
-
You can declare variables like: $SiteUrl="http://site.com";
-
Use This SQL: SELECT `products_name`,SUM(`quantity`) as Quantity FROM `product` Group By `products_id` Order By Quantity DESC
-
Yeh.. i Missed that part thanks Gristoi
-
Instead of making three fields for Year-Month-Date make one field and insert the data in that field. then It will be easier for you select the records
-
paste php code top of your page and connection should be declared on top: <?php $con=mysql_connect("localhost","dbs_dbs","password"); die("Can not connect: " . mysql_error()); mysql_select_db("dbs_forms",$con); if (isset($_POST['submit'])){ $sql = "INSERT INTO emails(player_name,email)('$_POST[playername]','$_POST')"; mysql_query($sql,$con); mysql_close($con); } ?>
-
I need to check ur remove function as well.. can u paste the whole code
-
Try this <a href=javascript:void(0)" id="'+type+'-'+desId+'" class="admin-managers">
-
I have written two functions to generate parent child relationship in menus //function to get the category list of a table when calling the function initially the 1st parameter will be 0(zero). function getCategory($catid, $tbl, $main_field_id="CatID", $parent_field_id="ParentID", $main_field_name="CatName", $separator=" --", $merge_with_db_table = false, $db_fields="*", $sql_cond="", $top_parent_id=0, $order_by_field=""){ //echo $separator; exit; global $cat_arr, $objDB,$level; $level = 0; if(!empty($db_fields)) $sql = "SELECT ".$db_fields." FROM `".$tbl."` WHERE `$parent_field_id`=".$catid." AND 1=1 ".$sql_cond; if(!empty($order_by_field)) $sql .= " ORDER BY `".$order_by_field."`"; //echo $sql . "<br>"; $res = $objDB->ddlQuery($sql); while($row=$objDB->get_row($res, 'MYSQL_ASSOC')) { $l = getLevel($row[$main_field_id], $tbl, $main_field_id, $parent_field_id, $main_field_name, $top_parent_id); $level=0; $append_string=''; for($i=1;$i<=$l;$i++){ $append_string.=$separator; } $append_string.=" "; $arr_temp = array("$main_field_id"=>$row[$main_field_id],"$main_field_name"=>$append_string.$row[$main_field_name],"level"=>$l); if($merge_with_db_table) $cat_arr[] = array_merge($row, $arr_temp); else $cat_arr[] = $arr_temp; getCategory($row[$main_field_id],$tbl,$main_field_id,$parent_field_id,$main_field_name,$separator,$merge_with_db_table,$db_fields,$sql_cond,$top_parent_id,$order_by_field); } //print_r($cat_arr); return $cat_arr; } function getLevel($catid, $tbl, $main_field_id="CatID", $parent_field_id="ParentID", $main_field_name="CatName",$top_parent_id=0) { global $cat_arr, $objDB,$level; $sql="SELECT * FROM `".$tbl."` WHERE `$main_field_id`='".$catid."' AND 1=1"; //echo $sql; exit; $result_parent=$objDB->ddlQuery($sql); $row_parent=$objDB->get_row($result_parent); if($row_parent[$parent_field_id]!=$top_parent_id){ $level++; getLevel($row_parent[$parent_field_id],$tbl,$main_field_id,$parent_field_id,$main_field_name,$top_parent_id); } return $level; }
-
Code seems ok.. same example code I have used in one of my applications..
-
Have u mapped your application with facebook api key?