| | |
msql data transer problems
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2005
Posts: 1
Reputation:
Solved Threads: 0
I am tring to complete a project for university using msql, php, apache and phpmyadmin(local)
The main basis for this project is being able to transfer data to and from a mysql database.
Having never used the languages required I am having trouble figuring out what I am doing wrong. All I want to do for now is put a record in a table using forms on a php page.
I have managed to put this together (see below) but all I get is "page cannot be displayed"
I have looked through the previous posts but I could not find one that helped
If any of you programming geniuses can help me out I’d really appreciate it
Thanks....flameifrit
I am using......
>php 4.3.9
>phpmyadmin 2.6.1
>msql servers and clients 3.23.49
>apache http server 2.0.50
**********************************************
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("TECH_HELL_FORUM",$db);
$sql = "INSERT INTO topic (ID,TopicName) VALUES ('$ID','$TopicName')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
ID:<input type="Text" name="ID"><br>
TopicName:<input type="Text" name="TopicName"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>
****************************************************
The main basis for this project is being able to transfer data to and from a mysql database.
Having never used the languages required I am having trouble figuring out what I am doing wrong. All I want to do for now is put a record in a table using forms on a php page.
I have managed to put this together (see below) but all I get is "page cannot be displayed"

I have looked through the previous posts but I could not find one that helped
If any of you programming geniuses can help me out I’d really appreciate it
Thanks....flameifrit
I am using......
>php 4.3.9
>phpmyadmin 2.6.1
>msql servers and clients 3.23.49
>apache http server 2.0.50
**********************************************
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("TECH_HELL_FORUM",$db);
$sql = "INSERT INTO topic (ID,TopicName) VALUES ('$ID','$TopicName')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $PHP_SELF?>">
ID:<input type="Text" name="ID"><br>
TopicName:<input type="Text" name="TopicName"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
} // end if
?>
</body>
</html>
****************************************************
![]() |
Similar Threads
- How to configure GD (PHP)
- Need some interesting Advanced Data structure problems. (C++)
- php.ini confusion (PHP)
- Redirecting a data source (Access 2k/VB6) (Visual Basic 4 / 5 / 6)
- how to append input at the end of the old data in a text file? (C++)
- mysql to msql data migration (MS SQL)
- data grid problems...please help (VB.NET)
Other Threads in the MySQL Forum
- Previous Thread: Saving Code in PHP
- Next Thread: Refresh Form to Display changes
| Thread Tools | Search this Thread |
agplv3 alfresco api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gnu government gpl greenit groklaw groupware hiring hyperic images innerjoins insert ip joebrockmeier join journalism keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope php query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





