Hello sir/madam,

I am facing some difficulty in designing a project related to database. Project is related to designing of a website of daily deals of products and maintaining a database of all the products. I am using php . mysql and xhtml for design and my query is how to make dynamic creation of a database and how to use it? Is there any way by which we can make the website automated by making it search for new deals browsing through other similar websites which get updated daily with such deals.Its like if anything new is found in those websites, my website should automatically add that product into the database and display it in home page with suitable links. Is this possible? I am doing this project for my university and i have no other way but to finish this project. Please please help.

Thanks & Regards,
Pruthvi Kumar B.k

First, you should show us some idea of what you think would work for your database schema, and only then will we be able to give some help.

Second, this is not really the right forum for talking about a web crawler. Once you have the crawler working well enough (or maybe you can just use a Google API?), you need to find some way to translate the recovered information so it can be stored in the database that you have designed in step one (so the need to do so should help drive that design).

Or instead of a crawler you could keep a hand-created list of web sites that you will always look at: It avoids the need to make a crawler, and it makes the translation step into a giant case statement instead of some kind of AI thing: Both are good ways to simplify your life.

Thanks fr the reply sir. i will post my code here and also mention the error displayed . please see if you can fix my problem. My code works fine in linux but doesnt work in windows. I am using wamp server here in windows and finding it real hard to execute my code.

My code has two parts 1 which is php code deals with the database and 2 XML which deals with the front end

<?php
$name=$_POST["name"];
$addressline1=$_POST["addressline1"];
$addressline2=$_POST["addressline2"];
$email=$_POST["email"];
$result=1;
$mysql=mysql_connect("localhost","root","")or die("connect error");
mysql_select_db("pruthvi");
$result=mysql_query("insert into form values('$name','$addressline1','$addressline2','$email')");
print "name=$name addressline1=$addressline1 addressline2=$addressline2 email=$email result=$result";
?>

<html>
<head>
<title>query DB</title>title>
</head>
<body>
<center><h3><? if($result==1)
print "record inserted successfully"; ?>
</h3></center>
<h4>current DB contents</h4>
<? $resullt=mysql_query("select * from form"); ?>
<table border="1" align="center" width="500">
<tr>
<th>name</th>
<th>addressline1</th>
<th>addressline2</th>
<th>email</th>
</tr>
<? while($array=mysql_fetch_row($result))
{
	print "<tr>";
	print "<td>".$array[0]."</td>";
	print "<td>".$array[1]."</td>";
	print "<td>".$array[2]."</td>";
	print "<td>".$array[3]."</td>";
	print "</tr>";
}
mysql_free_result($result);
mysql_close($mysql);
?>
</table>
</body>
</html>

XML code:

<?xml version="1.0" encoding="utf-8" ?>
<?DOCTYPE HTML PUBLIC "-//w3c//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form action="http://localhost/13a.php" method="post">
<table width="500">
<tr>
<td>name</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>addressline1</td>
<td><input type="text" name="addressline1"></td>
</tr>
<tr>
<td>addressline2</td>
<td><input type="text" name="addressline2"></td>
</tr>
<tr>
<td>email</td>
<td><input type="text" name="email"></td>
</tr>

</table>
<input type="submit" value="submit">
</form>
</body>
</html>

the values entered in the text boxes are inserted into the database. I checked them manually but are not getting displayed on my browser. It shows some error. I am posting that error below.

error shown after values are entered and submit button pressed is something like this :

name=pruthvi addressline1=kadur addressline2=bangalore email=pruthvikumar.123@gmail.com result=

current DB contents
"; print ""; print ""; print ""; print ""; print ""; } mysql_free_result($result); mysql_close($mysql); ?>
name addressline1 addressline2 email
" .$array[0]. " " .$array[1]. " " .$array[2]. " " .$array[3]. "


Please help how to debug this error and make the contents display in my browser.

Thanks,
Pruthvi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.