Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host="localhost";
- $username="";
- $password='';
- $db_name=$username;
- $tbl_name="inventory";
- $source = $_POST['Submit'];
- #$db_inven = mysqli_connect("$host", "$username", "$password", "$db_name");
- $db_inven = new mysqli("$host", "$username", "$password", "$db_name");
- # this function searches for albums with names
- # like the given album name
- function searchAlbum($album){
- global $db_inven;
- $prepSearch = $db_inven->prepare("SELECT artist, albm, qty, label, descr, " .
- "retail, wholesale, cost, medium, id " .
- " WHERE album like ?");
- $prepSearch->bind_param('ssissdddsis', $album); $prepSearch->execute();
- $prepSearch->bind_result($artist, $ralbum, $qty, $label, $description, $retail, $wholesale, $cost, $medium, $id);
- $results = array();
- while ($prepSearch->fetch()){
- array_push($results, array('artist' => $artist,
- 'album' => $ralbum,
- 'qty' => $qty,
- 'label' => $label,
- 'descr' => $description,
- 'retail' => $retail,
- 'wholesale' => $wholesale,
- 'cost' => $cost,
- 'medium' => $medium,
- 'id' => $id));
- }
- return $results;
- }
- $foo = searchAlbum("somealbum");
- Call to a member function bind_param() on a non-object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement