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
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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.