<?
//Get result from database using a function SafDBFunc
//From following function you will get an output staff name
//To get the staff name you need to pass some veribles like table name ($tablename) and databse conncetion ($db)
//and also the staff number ($staffid), it will go inside the function and open the databse in given table for the record
function TakeStaffNameSafDBFunc($tablename,$db,$staffid){
$sql = "SELECT * FROM $tablename where staffid='$staffid'";
$result = mysql_query($sql, $db);
$rows = mysql_num_rows($result);
if (mysql_num_rows($result_a)) {
$data = mysql_fetch_object($result);
$fldStaffName = $data->fldStaffName;
}
return $fldStaffName;
}
?>
Blogger templates
Blogger news
Blogroll
Archives
-
▼
2013
(219)
-
▼
July
(25)
- Form elements added by jquery not getting on the s...
- Sessions
- $_get() in php
- SQL: exists
- Php Error Control Operators
- Control structures in Php: return
- User logs out in php Penny Auction
- Security
- PHP File Uploading
- Assignment #7: User registration
- No title
- The History of PHP
- How to reset Mysql root pasword on Windows
- PHP foreach statement
- Php Tips
- Cake php Data validation
- How to use XMLHttpRequest
- While Loop in Php
- Reasons to Love PHP and MySQL
- The do while Statement
- Get result from database using a function SafDBFunc
- Javascript for checking Caps Lock is ON or OFF
- concatenation in php
- Php Comparison Operators
- PHP coding tips to write less code (If then else a...
-
▼
July
(25)