2 Replies - 352 Views - Last Post: 16 September 2012 - 07:57 PM Rate Topic: -----

#1 Java Neil  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 140
  • Joined: 26-March 11

Storing and retrieving a string in mysql

Posted 16 September 2012 - 06:35 PM

Hi all...I'm bran new to PHP and my boss has asked me to create a intranet site on our company's server that has a splash page that he wants the ability to have a "ticker" scrolling across the page in which he can have a input field to load the text and it will the display on the page.

My thought was to use PHP to store the string in a sql database and then call it back to the page. Could someone point me in the right direction on how to do this?

Like I said, I'm bran new to this so please go easy.

Is This A Good Question/Topic? 0
  • +

Replies To: Storing and retrieving a string in mysql

#2 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3718
  • View blog
  • Posts: 5,989
  • Joined: 08-June 10

Re: Storing and retrieving a string in mysql

Posted 16 September 2012 - 07:51 PM

Hey.

First of all, having stuff (text in particular) scrolling across the screen is bad. It's distracting, and frustrating to read. If your users read faster than it scrolls, then they're constantly waiting for more text to appear, which is just annoying as all hell. It's right up the with popup windows and alert boxes, as far as bad web UI design is concerned.

But, in any case, to manage this you'll have to use Javascript. There used to be a non-standard HTML element called marquee that did this, but it had serious issues at the best of times, and it's use is highly discouraged. You can, however, find many Javascript scripts designed to mimic the effect of that element, but usually in a much better (yet still bad) way. A Google search should turn up a few of those scripts.

As for providing the data for it. You could store it in a database, yes, but that might be overkill in this situation. As I understand you, you just need a single string to be stored at any one time. Unless you want to keep copies of previously used strings, you could simply put that one string into a text file on the server, using PHP, and pull that into the Javascript marquee code via AJAX when the page loads. All of that is pretty simple, really, once you get the basics of PHP and Javascript.
Was This Post Helpful? 0
  • +
  • -

#3 Java Neil  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 140
  • Joined: 26-March 11

Re: Storing and retrieving a string in mysql

Posted 16 September 2012 - 07:57 PM

Oh, I agree with the whole ticker thing on the page. I hate them! The boss is just insistent on it!

Could you show me an example of the javascript and AJAX required to do what you are suggesting?

This post has been edited by Dormilich: 17 September 2012 - 11:56 AM
Reason for edit:: removed quote

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1