i did a cms i wanted to put all my scripts into db and sort them. use one index and call upon parameters.
while i got you here 🙂 I set up another enviroment on pc where i am building another app. i did apache 2.2 mysql 5.0.41 php 5.0.
now i cant connect to db through mysql_connect i dont get an error all i get is some random 3 chars that look russian.
яЛП
here is my php
<?php
define('HOST','localhost');
define('USER','iia');
define('PASSWORD','kodak');
define('DATABASE','kodak');
$dbkodak = mysql_connect('localhost','iia','kodak') or die(mysql_error());
//$db = mysql_pconnect(ini_get("mysql.default_host"), ini_get("mysql.default_user"),ini_get("mysql.default_password"));
//if(!$dbkodak) { $message = "Could not connect to server!"}
if($_POST['input_submit']=='Register'){
// prerpare data to insert into database
$firstname = mysql_real_escape_string($_POST['input_firstname']);
$lastname = mysql_real_escape_string($_POST['input_lastname']);
$email = mysql_real_escape_string($_POST['input_email']);
$username = mysql_real_escape_string($_POST['input_username']);
$password = mysql_real_escape_string($_POST['input_password']);
$password = cryptpass($password,1000);
$status = 'user';
// select database
mysql_select_db(DATABASE,$dbkodak);
// write the query
$query = "INSERT INTO users ";
$query .= "(";
$query .= "firstname,lastname,username,status";
$query .= ") ";
$query .= "VALUES (";
$query .= "'{$firstname}','{$lastname}','{$email}','{$username}','{$password}','{$status}'";
$set = mysql_query($query);
}
?>
I granted ALL PRIVILEGES on . to 'iia'@'localhost'.
When I connect through navicat using the same host,user,pass I get a successful connection.
I cannot get why the function wont connect me.