sql - Interact with webmatrix database using PHP -
i having trouble using webmatrix database. insert data database registration page written in php.
when created database "web.config" file created. how can use connectionstring "web.config" file in php able connect database?
connection string web.config file:
<connectionstrings> <add connectionstring="server=localhost;uid=root;database=sitedetest;pwd=123" name="sitedetest" providername="mysql.data.mysqlclient" /> </connectionstrings>
i tried this:
config.php
<?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = '123'; $dbname = 'sitedetest'; ?>
in registration page:
include 'config.php'; $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die ('error connecting mysql'); mysql_select_db($dbname);
but when try using registration form, 'error connecting mysql' message
thank time
Comments
Post a Comment