Jump to content


Photo

creating and editing 'mediumtxt' via php


  • Please log in to reply
4 replies to this topic

#1 mATOK

mATOK
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts
  • LocationToronto, Ontario

Posted 14 August 2006 - 06:15 PM

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  ???
"Not everything that counts can be counted, and not everything that can be counted counts."

W3 Web Tutorials | Check Your html | CSS layout techniques | ALA | Zen Garden | CSS Links

Navs with flavor | CSS Playground | CSS boxes

#2 mATOK

mATOK
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts
  • LocationToronto, Ontario

Posted 14 August 2006 - 08:01 PM

**BUMP**

pleasr help  ???
"Not everything that counts can be counted, and not everything that can be counted counts."

W3 Web Tutorials | Check Your html | CSS layout techniques | ALA | Zen Garden | CSS Links

Navs with flavor | CSS Playground | CSS boxes

#3 mATOK

mATOK
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts
  • LocationToronto, Ontario

Posted 15 August 2006 - 12:37 PM

**BUMP**
"Not everything that counts can be counted, and not everything that can be counted counts."

W3 Web Tutorials | Check Your html | CSS layout techniques | ALA | Zen Garden | CSS Links

Navs with flavor | CSS Playground | CSS boxes

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 15 August 2006 - 12:55 PM

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

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);

Give something based on the tutorials a try. If it isn't working post again and show us your code explaining the problems.
Legend has it that reading the manual never killed anyone.
My site

#5 mATOK

mATOK
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts
  • LocationToronto, Ontario

Posted 15 August 2006 - 01:06 PM

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.


"Not everything that counts can be counted, and not everything that can be counted counts."

W3 Web Tutorials | Check Your html | CSS layout techniques | ALA | Zen Garden | CSS Links

Navs with flavor | CSS Playground | CSS boxes




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users