Jump to content

Recommended Posts

How do I make a form and stuff to submit info into a MYSql database, and then make it so it shows up on a page..


[code]

<?php

$id = 1;
$conn mysql_connect('Localhost', 'root', '******')
or die('Could not connect');

mysql_connect_db('website', $conn) or die('Could not connect to database');

$sql = "SELECT title, body FROM news WHERE id=$id";
$result = mysql_query($sql) or die(mysql_error());

$row = mysql_fetch_array($result, MYSQL_ASSOC);

echo $row['title'];
echo $row['body'];

?>

[/code]

I just don't know how to make a page for Editing it, and adding new news.. Please help.
Link to comment
https://forums.phpfreaks.com/topic/27067-a-mysql-php-or-php-mysql-tables/
Share on other sites

Ok there are a few questions. One is do you want to learn PHP or simply use it. If you want to use it, download a fully functional script from one of the many available resources on the web. If you want to learn it this brings us to another question, how much do you want to learn. If you want to have a comprehensive knowledge of the fine paininthearse art of PHP, I would advise you to consult a manual, such as on http://www.php.net/. If you want to learn it just for this, give up and download a script eh?

This is a help forum, not a do-it-for-me forum.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.