hello to all,

would somebosy help me creating a library system that consist of book inventory, barrower form, validation of user hope someone could be able to help.

iam new in php/mysql and have no idea how to start please help me i will truely appreciate all your help.


8 Years
Discussion Span
Last Post by ajie6673

You could do this rather simply using a MySQL database by creating a books table, with columns like title, author, checkedout, checkedoutdate, etc.

I would recommend you look for a book on PHP/MySQL to become more familiar with the basics. Or, visit www.php.net/docs.php or www.mysql.com for more in-depth documentation.

If you have any more specific questions, I'd be glad to answer them.

Hope this helps


thanks for the info, ive already created some table on mysql but having some trouble on how to call what i've had done with mysql using php. hope you could be able to help me.

thanks for the reply


Alright, say you have a table named booktable with columns named bookid, title, author, and checkedout. Then to get that information out of the database, you need to query your database with mysql_query();. To return a table row that has a book id of 5, you use the SELECT command in PHP. So your code could look something like this...


//lets start by connecting to mysql you only have to do this once in your page.
$con = mysql_connect('yourhost','yourusername','yourpassword');
if (!$con) {
die ('Could not connect: ' . mysql_error());

//select your database
mysql_select_db('yourdatabase', $con);

//now query the database
$query = "SELECT bookid, title, author, checkedout FROM booktable WHERE bookid=5";
$result = mysql_query($query, $con);

//But now the result is in the form of an object.  To get information out, we can use mysql_fetch_assoc().

$row = mysql_fetch_assoc($result)

$bookid=$row['bookid'];  // now $bookid has the bookid for this book.
$title=$row['title'];  //same here, etc.


This is very basic, there's a lot more you can do with MySQL that can make your application much more powerful. Hope this helps.


thanks for the info, i'll try create something base on your script. ill try to figure how does it works. hope to hear from you again.

ill keep you inform on would be the status on the system that i've been doing

again thanks for your help.


thanks for the reply, would you help out how to create a simple form. consist of book reference no., title, author, category, and quantity.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.