Hello everyone.
I'm having troubles creating a db with a query.
I'm reading a book called PHP Bibles from Tim Converse
I get this error
Fatal error: Call to undefined function mysql_create_db() in /Applications/XAMPP/xamppfiles/htdocs/testing/10/ch22/weblog_db_create.php on line 8
Not sure why and help would be great.
Here is the code:
Code: <?php
// You'll probably have to be the root MySQL user to run this script.
// If you can't get that permission, you could alter the script below
// to create tables in your pre-existing database.
include("db_password.inc");
mysql_connect($hostname, $user, $password) or die("Failure to communicate");
$try_create = mysql_create_db("weblogs");
if ($try_create > 0) {
echo ("Successfully created database.<BR>n");
mysql_select_db("weblogs");
$query = "CREATE TABLE login (ID SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, username VARCHAR(20), password VARCHAR(20))";
$result = mysql_query($query);
// Since we're not using the standard MySQL
// date format, store date as an integer
$query2 = "CREATE TABLE mylog (ID SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY, date INT(8), blogtext TEXT)";
$result2 = mysql_query($query2);
mysql_close();
if ($result > 0 && $result2 > 0) {
echo ("Successfully created tables<BR>n");
} else {
echo ("Unable to create tables.");
}
} else {
echo ("Unable to create database");
}
?>
Password for db_password.inc
localhost
nomad
nomad
Many thanks
Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything.Code: <td class="row3"><input type="text"
default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?
button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdoes not works any slolution ?
Change Sort Order to Display Newest File First
Hi Guys,I have a page that sorts the contents (PDFs) of a directory and displays them on the webpage chronologically from the oldest (at top) to the newest (at bottom).I'd like to reverse this display
Using Windows message as a Handle
Hi,
Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto_increment.I need to pull the auto incremented ID # for the entry I just posted onto the page so the
Mail from PHP form not always ending up in my inbox?
Hi guys,I'm a real newbie to PHP and have managed to put together a simple mail form that sends me an email when someone fills it in on my site.The problem I am having, is that sometimes when I test
update post issues
I am trying to create an update to a post function, while the update does occur, the page routing and selecting of posts to be updated is whats getting screwed up. I have so many files involved in
Help with file_get_html
The following code gives the expected results:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
I would like "for" to wait 5 sec
I would like my 'for' loop to wait 5 sec before second iteration.for ($i=0; $i<10; $i++){........//I would like it to wait 5 seconds here}