<form action=”” method=”post”>
<input type=”text” name=”search”>
<input type=”submit” name=”submit” value=”Search”>
</form>
<?php
$search_value=$_POST[“search”];
$con=new mysqli(“localhost”,”username”,”password”,”Judges_Calendar”);
if($con->connect_error){
echo ‘Connection Faild: ‘.$con->connect_error;
}else{
$sql=”select * from information WHERE Judge like ‘%$search_value%'”;
$res=$con->query($sql);
while($row=$res->fetch_assoc()){
echo ‘First_name: ‘.$row[“First_Name”];
}
}
?>
Connection Faild: Access denied for user ‘username’@’localhost’ to database ‘Judges_Calendar’
that is the message i receive. im using the username and password found in my gridpane account info. (username and passwords have been changed for this post)
im not sure if i just dont have permission or something
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘dbname’ );
/** MySQL database username */
define( ‘DB_USER’, ‘username’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ‘password’ );
/** MySQL hostname */
define( ‘DB_HOST’, ‘localhost’ );
/** Database Charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8’ );
/** The Database Collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ” );