Jump to content

Broad help needed


pourmeanother

Recommended Posts

I am an absolute beginner when it comes to PHP, SQL, and the like-- and I'm thrust into a task that I just can't figure out.

 

I am downloading the PHP 5.2.6 version onto my Windows computer right now. I have a domain and webhosting with MySQL capabilities....

 

What I want to do is have a form on a page, and have the information submitted via the form automatically posted on the same page. There's other more detailed specifics, but having the form post is the basic concept I'm trying to figure out (the other stuff I can work on later).

 

I was told I need to use PHP to interpret the information, pass it to a MySQL database, and then call the information from the database to have it posted.

 

Being the total noob that I am I have absolutely zero idea of how to do that. I've researched about every PHP tutorial I could find on google to no avail (most of them are incomplete and leave out important descriptions, confusing for beginners, or specifically teach how to have contents of the form emailed to me- whereas I'm looking for how to post them).

 

---------------

 

If somebody could help explain everything in a detailed way that a 5 year-old would understand, that would be GREATLY appreciated. Any relevant links, sample codes, or your own concepts would be solid.

 

Thanks guys, appreciate the help.

Link to comment
https://forums.phpfreaks.com/topic/130197-broad-help-needed/
Share on other sites

Thanks for the link. I was hoping to take the free route here I'm personally putting a lot of money into this-- but I bit the bullet and went and bought a PHP/MySQL book. Now I'm not so helpless as in my initial post.

 

Could you guys look this over and see if I'm on the right track. The following code is designed to pull data from a table called "FirstnameLastname" under the database "databasename" and display it on a page.

 

<?php
$connect = mysqli_connect("localhost", "account", "password", "databasename")
or die("Error");

$query = "SELECT * FROM LastnameFirstname";
$result = mysqli_query($connect, $query)
or die("Couldn't retrieve data");

while( $row = mysqli_fetch_assoc($result) )
{
extract($row);
echo "<table>";
echo "<tr><td><hr></td></tr>";
echo "<tr>\n
<td>$semester, $year</td>\n
<td>"Comments:"\n$comments</td>\n
</tr>\n";
echo "<tr><td colspan='2'><hr></td></tr>\n";
}
echo "</table>\n";

mysqli_close($connect)
?>

 

Once I have this fixed, I need to work out submitting a form and having the form data transferred to the appropriate tables in the database. I guess I'm working backwards, for some reason  :)

Link to comment
https://forums.phpfreaks.com/topic/130197-broad-help-needed/#findComment-675312
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.