Jump to content

A MySql > PhP, or PhP > MySql tables.


Phsycoslaya

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.

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.