Monday 10 August 2015

populating an html dropdown with dynamic data from mysql database using php

code snippet:

<select name="item_name">
<option value="">Select an option</option>
<?php 
include "db_config.php";
$sql="select * from tb_name";
$query=mysql_query($sql);
while($result=mysql_fetch_array($query)){
?>
<option value="<?php echo $result['column_id'];?>"><?php echo $result['column_name'];?></option>
<?php
}
?>
</select>

if you dont want to reffer to the already db_config we created reffer to the post which uses the mysql function.

Replace the tb_name with the name of the database table your want to populate data from.
Replace the column_id with the correct column_id which you want to populate.
Replace the column_name with the database column name you want to be displayed.

Saturday 29 March 2014

Programming for All

The management of Nobicom Labs here by inform everyone that they are trying to reach programming to everyone interested.
You are requested to always visit  Nobicom Labs page and post your comments and questions

powered by  Nobicom Labs

unpacking Ruby

Ruby Syntax

#!/usr/bin/ruby -w

puts "Hello, Ruby!";
 
get more......  

Unpacking python/

comming soon 
>>> a, b, c = 1, 2, 3
>>> a, b, c
(1, 2, 3)
>>> a, b, c = [1, 2, 3]
>>> a, b, c
(1, 2, 3)
>>> a, b, c = (2 * i + 1 for i in range(3))
>>> a, b, c
(1, 3, 5)
>>> a, (b, c), d = [1, (2, 3), 4]
>>> a
1
>>> b
2
>>> c
3
>>> d
4

Hack: a new programming language for HHVM

Hack :a new programming language for HHVM