Problem with database (XAMPP)

Page 1 of 1

1 Replies - 895 Views - Last Post: 06 June 2012 - 10:02 AM Rate Topic: -----

#1 demoloution   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 14-November 10

Problem with database (XAMPP)

Posted 06 June 2012 - 09:46 AM

Hello all,

i wasnt sure where to post this question, because i have problem with either my database or my php file.
So i have a main.html file and i want through the POST command to allow users to enter book elements like title, isbn, theme etc.
To do this, like i read on tutorials, you need to have a .php file with some commands in it that will allow to send the data inserted by the user to your mysql base (localhost).

I passed through blank pages and browser showing me all my script until i got to this error:

Notice: Undefined index: BOOK_CODE in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 11

Notice: Undefined index: BOOK_ISBN in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 12

Notice: Undefined index: BOOK_TITLE in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 13

Notice: Undefined index: MAIN_THEME in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 14

Notice: Undefined index: PUBLISHER_NAME in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 15

Notice: Undefined index: YEAR_OF_ACQUISITION in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 16

Notice: Undefined index: BOOK_SUMMARY in C:\xampp\htdocs\xalkidi\insertBOOK.php on line 17

my main.html and insertBOOK.php codes are the following :


<title> E-Library </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Imagetoolbar" content="no">
<style type="text/css">
html {height:100%;}
body {height:100%; margin:0; padding:0;}
#bg {position:fixed; top:0; left:0; width:100%; height:100%;}
#content {position:relative; z-index:1;}
h1 {font-size: 32pt; color: red}
a {font-size: 24pt; color: blue}
h2 {font-size: 18pt; color: red}
form {font-size: 18pt; color: red}

<div id="bg"><img src="mystery.jpg" width="100%" height="100%" alt=""></div>
<div id="content"> 
<h1 align = center><p>E-Library<p></h1>
<h2><p>Welcome to E-Library, the best place to search&share your favorite books!!!</p></h2>
<a href = "" target = "new"><p> LEARN MORE </p></a>
<a href = "insertBOOK.php" target = "new"><p> test </p></a>
<form name="inputBOOK" action="insertBOOK.php" method="post"><p>
BOOK_CODE: <input type="text" name="BOOK_CODE" />
BOOK_ISBN: <input type="text" name="BOOK_ISBN" />
BOOK_TITLE: <input type="text" name="BOOK_TITLE" />
MAIN_THEME: <input type="text" name="MAIN_THEME" />
PUBLISHER_NAME: <input type="text" name="PUBLISHER_NAME" />
YEAR_OF_ACQUISITION: <input type="text" name="YEAR_OF_ACQUISITION" />
BOOK_SUMMARY: <input type="text" name="BOOK_SUMMARY" />
<input type="submit" value="OK" />


$con = mysql_connect("localhost","admin","");

if (!$con)
die('Could not connect: ' . mysql_error());



echo $BOOK_CODE ;
echo $BOOK_ISBN ;
echo $BOOK_TITLE ;
echo $MAIN_THEME ;


// some code


I am new to this so any help would be appreciated :)
Thank you

Is This A Good Question/Topic? 0
  • +

Replies To: Problem with database (XAMPP)

#2 modi123_1   User is offline

  • Suitor #2
  • member icon

Reputation: 14092
  • View blog
  • Posts: 56,460
  • Joined: 12-June 08

Re: Problem with database (XAMPP)

Posted 06 June 2012 - 10:02 AM

Let's not create duplicate topics.. thanks!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1