Reply
newbie help required
Old 07-28-2004, 06:43 AM newbie help required
Average Talker

Posts: 22
Location: India
i want to make a dynamic website using php & mysql database ..my website is hosted on apache server

http://www.websitepublisher.net/arti...p-mysql-intro/

i tried to follow this article

this is what i did:

1) made add.html as told in Adding Data and changed its permission to 666
2) then i put the next part of the article in added.php and made the table manually ... becoz i couldn't understand where to put the code given in Getting Started

when i fill the form in add.html it gives the error written in added.php ...

second problem is that even after adding manually in the table i m unable to Returning Data

what wrong have i done?
taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
When You Register, These Ads Go Away!
Old 07-28-2004, 07:53 AM
Republikin's Avatar
Super Moderator

Posts: 3,191
Please post the error and add.html as well as added.php
Republikin is offline
Reply With Quote
View Public Profile
 
Old 07-29-2004, 01:30 AM
Average Talker

Posts: 22
Location: India
add.html

<html> <head>
</head>
<body>
<h2>Add Data

<form method="post" action="added.php">
Name: <input type="text" name="xname"><br>
Author: <input type="text" name="xauthor"><br>
Description: <textarea name="xdescription"></text><br>
Body Text: <textarea name="xbody"></text><br>

<input type="submit" name="add" value="SUBMIT">
</form>
</body>
</html>


added.php

<html>
<head>
<title></title>
</head>


<body bgcolor="#FFFFFF">

<?php

$connect = mysql_connect("localhost", "user name", "pass");

mysql_select_db("guruofse_db1", $connect);

if($add == "SUBMIT"){
$sql = "INSERT INTO content SET
Name='$xname',
Author='$xauthor',
Body='$xbody',
Description='$xdescription'";

if(mysql_query($sql))
{
echo "The information has been added to the database.";
}
else
{
echo "There was an error submitting the information.";
}


} // closing bracket for original IF statement
?>


</body>


</html>




have put user name & passwd

error message There was an error submitting the information.

Last edited by taj79 : 07-29-2004 at 01:35 AM.
taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
Old 07-29-2004, 08:15 AM
Republikin's Avatar
Super Moderator

Posts: 3,191
Try putting or die(mysql_query()); after each mysql function and post that error. That will help narrow it down to which thing is causing the most trouble.
Republikin is offline
Reply With Quote
View Public Profile
 
Old 08-01-2004, 11:45 PM
Average Talker

Posts: 22
Location: India
Hi,
i couldn't understand what you suggested. Could you please explain?

also i have made a table called test inside the database ... Does added.php mention it also?

i have hosted my website in apache server with cpanel ..

Last edited by taj79 : 08-02-2004 at 12:17 AM.
taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
Old 08-02-2004, 04:09 AM
Average Talker

Posts: 22
Location: India
i tried using the help of another tutorial:

http://webmonkey.wired.com/webmonkey...tw=programming

i m trying to make a php page which will use the mysql database .. and following the instructions given in this webpage ..

i have created a database and a table named employees inside it ..
i m using Cpanel.



Code:
SQL-query : [Edit] [Create PHP Code] 
CREATE TABLE `employees` ( 
`id` TINYINT( 4 ) DEFAULT '0' NOT NULL AUTO_INCREMENT , 
`first` VARCHAR( 25 ) NOT NULL , 
`last` VARCHAR( 25 ) NOT NULL , 
`address` VARCHAR( 255 ) NOT NULL , 
`position` VARCHAR( 50 ) NOT NULL , 
PRIMARY KEY ( `id` ) 
);


and inserted data manually in the table ..


Code:
Inserted rows: 1 
Inserted row id: 2 
  
SQL-query : [Edit] [Create PHP Code] 
INSERT INTO `employees` ( `id` , `first` , `last` , `address` , `position` ) 
VALUES ( 
'2', 'vxvsv ', 'ghjhk ', 'y  5u5uj tj tjtj', 'tthj' 
);

then i put the code given in webmonkey webpage in a file testemployees.php

http://www.guruofseo.com/testemployees.php

but its not showing ...

what's the mistake i have done ..? and how to correct it ..
taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
Reply     « Reply to newbie help required
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13902 seconds with 12 queries