Jump to content

Recommended Posts

Hello all,

 

I've created an auto-response script for work, which originally stored the auto-response script (the paragraph of text) in a php file that I would include into the actual form.  I have decided to use MySQL to try and make it a little more flexible, however I'm wondering how I can use MySQL to pull the output script from Mysql.

 

Right now, I have a table called output_scripts, a column called SID and another column called OutputScript.

 

OutputScript contains the text that I want to generate (Hello, $name - your password is $password.  Please proceed to log in to $url -- for example) and SID is auto incremented.

 

Can I call SID to pull the text I need from OutputScript?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/278065-echo-a-string-by-unique-key/
Share on other sites

I've not touched MySQL in years so I'm basically coming back to it 'for the first time',I'm not enitrely sure what is I'm asking.

 

What I need is to store a couple of paragraphs into MySQL, and echo that content by referrencing an ID because I want the content editable.

 

I suppose the best way to explain what I mean is, let's assume it's a news article.  I want to be able to store the article in MySQL, echo said article into a PHP script, allow the user to completely rewrite the article and still have it echo the edited column entry.  Does that make sense?  I'm struggling to put it into words lol.

 

In Pseudo-code:

 

Content goes into Column 1

 

Echo Column 1

 

User edits content that belongs to column 1

 

Echo Column 1 (which will be the edited content, not the original)

Edited by RetroSpock

here is a tutorial I wrote on CRUD - Create, Read, Update and Delete.

http://thewebmason.com/php-mysql-crud-tutorial-using-pdo-create-read-update-delete-part-1-create/

 

It should cover everything you need for a basic CRUD like what you're describing.

Edited by Jessica
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.