I bet this is real simple but
I get an error that reads
"Call to a member function prepare() on a non-object"
seems like it must be a pretty common error and yet I cannot find anything on it that explains why I am getting this in my php
I tried a million things but no luck
anybody know what im doing wrong??
help please
Code: Select all
<?php
function upload_images($selector, $strainName, $clubId){
if($stmt = $mysql -> prepare("INSERT INTO products (selector, labelLink, clubId) VALUES(?,?,?)")) {
$stmt -> bind_param("sss", $selector, $strainName, $clubId);
$stmt -> execute();
$stmt -> close();
}
}
}
if(array_key_exists('send',$_POST)){
$var1=ucfirst( $_POST['strain']);
$var2= ucfirst($_POST['selector']);
$var3= $displayinfo;
upload_images($var1, $var2, $var3);
}
?>