Posts

Showing posts from February, 2016

php code to insert selected checkbox values into single mysql column comma separated

Image
Insert comma separated values into database column in mysql using PHP Download

One More Fieldset Multi Step Form with Js validation spam protection

Image
multi-step form with multifieldset   download

PHP NESTED LOOP (WHILE) TO DISPLAY DATA IN CATEGORIES

$query1= "SELECT DISTINCT OMEX_CAT FROM extras"; $result1=mysqli_query($conn, $query1); while($row1=mysqli_fetch_assoc($result1)){         $value=$row1['OMEX_CAT'];         echo  '<h3>'. $value.'</br></h3>';                 $query2= "SELECT * FROM extras where OMEX_CAT ='". $value. "'";         $result2=mysqli_query($conn, $query2);         while($row2=mysqli_fetch_assoc($result2)){             $value2=$row2['OMEX_NAME'];             echo $value2.'</BR>';         } echo "</br>"; } CATEGORY ONE Item 1 Item 2 CATEGORY TWO option 1 option 2

using a php variable in the WHERE clause of a mysql query

              $query2= "SELECT * FROM extras where OMEX_CAT ='". $value. "'";         $result2=mysqli_query($conn, $query2);   

PHP MYQL WHERE CLAUSE WITH AND

SELECT * FROM Customers WHERE Country='Germany' AND City='Berlin';

alter table Drop / Deleting Foreign Key in MySQL

To remove the key: ALTER TABLE table_name DROP KEY `key_column`; To remove  foreign key: ALTER TABLE table_name DROP FOREIGN KEY `table_name_ibfk_1`;

Alter table add foreign key in mysql

SET foreign_key_checks=0; ALTER TABLE extras   ADD FOREIGN KEY (OMDR_ID)   REFERENCES dress(OMDR_ID)

Disable right click USING JQUERY

<table id="tableID" border=1>     <tr>         <td class="disableRightClick">right click disable</td>         <td>right click</td>     </tr>     <tr>         <td >right click</td>         <td class="disableRightClick"> no right click</td>     </tr>     </table> JS FILE //to disable right click in entire document //uncomment this to check the rightclick diabled for entire document /* $(document).on("contextmenu",function(e){         alert('right click disabled');         return false;     }); */ //to diable right click in certain element $('.disableRightClick').on("contextmenu",function(e){                 return false;     });