Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 22
Location: India
Trades: 0
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?
__________________
Kaushik Acharya

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
 
Register now for full access!
Old 07-28-2004, 08:53 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Please post the error and add.html as well as added.php
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 07-29-2004, 02:30 AM
Average Talker

Posts: 22
Location: India
Trades: 0
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.
__________________
Kaushik Acharya

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by taj79; 07-29-2004 at 02:35 AM..
taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
Old 07-29-2004, 09:15 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 08-02-2004, 12:45 AM
Average Talker

Posts: 22
Location: India
Trades: 0
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 ..
__________________
Kaushik Acharya

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


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

Posts: 22
Location: India
Trades: 0
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 ..
__________________
Kaushik Acharya

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

taj79 is offline
Reply With Quote
View Public Profile Visit taj79's homepage!
 
Reply     « Reply to newbie help required
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.81506 seconds with 12 queries