php dot operator or concatenation operator syntax: "kamlendra"."kumar"."jha"; or 'kamlendra'.'kumar'.'jha';
Important concept by quote. quote strting is terminating quote if continue then use of concatenation operator
$sql = "INSERT INTO courier (party,docket) VALUES ( ' " // terminated here //concatination start .$party."// balance quote ' // syntax code , '".$courier_details."' )";
things known
1. connect to data base it contains localhost ,username , password. and value passed to connection variable.
2. select data base by using mysql_select_db("narendri_giga", $conn) or die( mysql_error() ); by passing parameter database name ans connection variable.
3. now connection and data base selected.
4. sql query
5. run my sql query and validate query
$run=mysql_query($query,$conn);
if($run==TRUE){
6.action code else throw error
7. call function
print_r() php function will show data for array varable.
isset() check if variable has value then true else false
jquery prop() is used to set or get prperty or attribute value of html element
<pre> sed to display
msql _ query() used to run query
mysql_fetch_array() used to fetch row from table
checkbox atrubute checked unchecked name value
mql_query(connection variable , sql query) correct format
short summery
1. form design 2. action page 3. method 4. input and name attribute 5. submit button
on action page
submit button action coding
database table
<?php
$str = "this string contains ";
$array = array(10,12,14,18);
echo "Before str ".$str;
for($i=0;$i<count($array);$i++){
//echo $array[$i]."<br>";
$str .= "'".$array[$i]."',";
}
$str = rtrim($str,',');
echo "After Concat ----".$str;
?>
delete syntatx:
|
DELETE FROM table WHERE condition; eg :
|