Posts

Showing posts from September, 2017

Populating dropdown - PHP Ajax MySQL

Image
The  output Step 1  Make City  table. CREATE TABLE `City` (   `ID` int(11) NOT NULL auto_increment,   `Name` char(35) NOT NULL default '',   `CountryCode` char(3) NOT NULL default '',   `District` char(20) NOT NULL default '',   `Population` int(11) NOT NULL default '0',   PRIMARY KEY  (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Step 2 : Write HTML Code                                 <select id="city " name="city" placeholder="Select City" class="form-control" > </select>                              Step 3: Write php Code save as cityapi.php <?php $link = mysql_connect ( "localhost" , "root" , "" ); if (! $link ) { die ( 'Could not connect: ' . mysql_error ()); } if ( mysql_sel...