Jump to content

creating and editing 'mediumtxt' via php


mATOK

Recommended Posts

Hello out there!

I have a DB that I am going to be populationg via a form that I am going to create in html/php.

I have 4 fields in my DB that are of type mediumtxt. When I use MySQL consol manager i am prompted to save and name my txt files and then to apply so that the record is loaded from the file.

How do I go about doing this via a form? I have a naming convention so I'm hoping that I can submit some mysql command...

please help  ???
Link to comment
https://forums.phpfreaks.com/topic/17538-creating-and-editing-mediumtxt-via-php/
Share on other sites

Look at any of the tutorials here that use databases. Typically you need two parts - a form to gather informnation; a form processing part to receive it and stick it in the database.

form method=post action=form_processor_script.php
fields for each item
/form

[code]
processor script
retrieve POSTed variables from the $_POST array
check inputs as valid (strip_tags(), addslashes(), trim() whatever)
make database connection
create MySQL INSERT query
$query = "INSERT into your_tablename (fields) VALUES (values)
execute query
$result = mysql_query($query);[/code]

Give something based on the tutorials a try. If it isn't working post again and show us your code explaining the problems.
Thanx AndyB,

I have created forms and updated tables no problem, my concern here comes from using the medium txt data type and how to name the files I am creating / apply the link to the db.

Would it be best for me to simply create a txt file using php and then store a link to said file in the db?

I will look through the tutorials again to see if there is something there that deals with mediumtext.

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.