Can someone explain the concept of MySQL to me? [closed] - mysql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
First and foremost, I do understand that MySQL is used for databases, and can be used to update content on a website. What I don't understand is how you actually are able to get MySQl to change the content on a site automatically, or if it is even possible. I really am a beginner so sorry if this question comes comes as noobish. I really don't understand the concept of MYSQL all that much, as I don't understand how websites are able to change the content on their main page daily using MYSQL, Now what I am saying is, if I were to have a website with new information every single day on the main page, and used Mysql as a database, would it be possible to upload for example 7 html files one for each day of the week,to the database, and have each of them displayed on different days, automatically? (This is all a presumption as I don't know how to get the data into a mySql database and if you upload a html file to the database) Sorry for the confusing question and thanks in advance for all the help.

As you mentioned, MySQL is just a database. You could in theory use Oracle or SQL Server or PostgreSQL, which are all MySQL's "competitors", if you will, in the database space.
What's generally done is that there is a program that sits alongside the web server on the box that reads the content from the database and then translates that content into HTML, where it's served up to you as a web page. This program is usually referred to as a Content Management System or "CMS" (You might want to Wikipedia for "Drupal", which is one popular CMS out there).
Web pages are rarely stored as whole HTML files in MySQL. Usually what's done is that the content (paragraphs of text, comments on a blog, upvotes and downvotes) are stored in some structured format, and the CMS takes that structured data from the database and presents it to you. The upshot of structuring the data in this way is that end-users who want to update content don't have to worry about coding the HTML -- they just write their content and the CMS takes care of the presentation bits.

MySQL is a database server, and doesn't have any web-related functionality built in. It's just a place to store data (though it's very good at that - it, and other relational database management systems like SQL Server and Oracle, attempt to optimize data storage and retrieval).
There's a layer between the database and the web server that you're missing - the web application framework. That's where your logic goes. If you want to display different data based on the day of the week, you'd program that in your web application:
// ludicrously simplified
if (Date.DayOfWeek = Friday)
Output "<html>TGIF!</html>"
PHP and ASP.NET are the best known languages for this kind of development.
There are a number of frameworks out there that simplify certain tasks. You can write HTML more or less directly from your code, using the languages above and the right runtimes (the ASP.NET runtime comes with Microsoft's IIS web server, and Zend is popular for PHP). Or with the right tools, you can specify the content each user sees at a very high level.

You can have some code/algorithm to rotate the news (articles) in your home page. Those articles can be inserted/stored into your MySQL database.
What I mean by rotate is that for each day a given article is retrieved from the database and shown on your homepage.
The articles can be inserted by hand on a given table in your MySQL database or they can be inserted using some kind of front end (a user form) for that purpose.
For a complete overview of MySQL, this page on Wikipedia is a good hit.

I don't know if the other answers have helped you understand, so I'll add a very simplistic answer that I hope will get you over the initial bump.
MySQL will act as an online storage space for you, but it won't provide the website.
In between MySql and the website, there will need to be a program of some sort.
There are many, many different languages and frameworks available to do this, and it's essentially the entire business of web developers to create these programs.
In your particular case, you asked about uploading different pages to MySql and having them displayed for each day of the week.
You wouldn't need to use MySQL or a database at all for this, a few lines of code in most common languages would do this for you, and adding a database would simply add complexity where it wasn't needed.

Related

Use of MYSQL to edit elements in HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
So, I'm making a website for a music collective that I'm in, and on that site there's a page where you can see all the albums (a simple 300 x 300px hyper link image) that redirects you to a bandcamp page.
As of now, if I want to add another album I must go into the HTML file and manually add it. My question is, is it possible to use MYSQL to add albums?
And by that I mean that everytime I "add an album" in MYSQL it will edit the HTML automatically? And if so, how do I do?
This is how the code looks:
HTML
<div class="product-box fade-in-drop">
<!-- album -->
<div class ="album">
<img src="exmaple.com">
</div>
</div>
EDIT:
It might be worth noting that I use a web hosting service that has a cPanel so I have database access, I just don't know how to write the code to make my plan possible.
I apologize if I am assuming too much here.
Your question implies that you want to move from a static website to a dynamic one where, instead of the HTML having static data, your information comes to the page by way of a web server making a connection to a database via some sort of intermediary, third party software. This is much more complicated than what you are doing now, but it is certainly not the most difficult task for creating a simple website that has outgrown the needs of a static page.
Here is a nice tutorial I have found, for an introduction. But I would recommend getting a book on LAMP development, particularly one that is more current than that article. You also might want to look into Drupal, though that might be overkill depending upon how simple your needs are.
It's not possible with pure HTML. You need some server side logic to query the database, like PHP, python, perl etc., and use the data to build the HTML dynamically.
You can't use HTML5 / Javascript dynamics because they are run by the client, your database is on the server.
What you can do based on the information you have given us is take the data that exists currently in the cPanel database access and find some way to copy that data into MySQL whether it's importing it directly, using Excel, or whatever. That would be the best way to go and then set up a connection to the MySQL database server. As mentioned you can use PHP, python, etc. to manipulate that data and have access to read/write that data through your site. Just by googling the basics you should be set on the right path to get a working dynamic website.

What should I look towards to create an easily maintainable news page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create a news page on my website but I cant figure out how I should make it easily manageable.
The idea would be to have the latest news appear at the top and for it to knock the older news further down as new news is added.
Someone mentioned mySQL, had a little look but seemed quite complicated for what I want to do.
Really old news would go into a drop down menu, so to save space/loading etc
I'm going to assume that given you've just tagged HTML and CSS and you obviously aren't using a database that this is a basic hand coded site.
If you aren't going to use a database (honestly this is probably the right approach) you're at least going to need a dynamic language, the easiest to accomplish it would be PHP.
This is the kind of thing that CMS's like WordPress do right out of the box. CMS is Content Management System, and your news page is exactly that.
It would be relatively quick and painless to write for even a moderate PHP developer. If you didn't want to use a database (you should) you could load flat documents then create each news article as it's own document. Parsing the creation date and sorting, then relegating to a dropdown is pretty basic stuff.
You'll need a database and a server-side programming language.
HTML and CSS just format what the website looks like, they don't possess the capability to store and retrieve data under certain conditions.
PHP is one such example of a server-side language. While I don't think PHP is a very good language, it's kind of the best in the world for teaching beginners because it puts into context the logic of what's happening by making you deliberately write it out. Other ways of making web applications like Ruby on Rails aren't so good because they're based on the premise of following conventions and automatically generating groups of files for you, what you're actually doing might only come into context much later down the road.
MySQL is a Structured Query Language and it's used to query information, most usually from databases. You'll need to use an SQL in some regard in conjunction with your server-side language.
Look up some tutorials on creating databases and querying information from them, preferably starting out with a language like PHP. This will probably be under a title like "Create a news website".

iOS Login Screen For External Sqlite Server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Ok, so say I wanted to have a sign up form similar to the iOS apps of Facebook, Gmail, Dropbox etc. I don't mean I want to have the users be able to login using those services (although that would be nice) but I want to actually have something similar to a SQL server as the web service https://parse.com/ would use.
It seems like a great service and very easy to setup, but I would like to go the extra mile and take advantage of the servers I have available in the cloud to create my own custom version of the following. I understand that mySQL isn't very usable within the iOS development platform, however sqlite3 is. Say I've created my storyboard layout and I think I have an idea of what it is I would like to do. I just don't know what I need to do to achieve it! Essentially what would be ideal is to to create statistical models based on the combined data from all of the users.
Properties of the application:
I would like the users also to be able to go online and download the data they entered into the iOS app by importing it into excel. However it would be very important that I nor any other user could identify the source of the data. As most of my users are going to know of each other in real life. Think of the app as something to do with drag racing, and the users enter in there race results and information about their setup and then upload it to my server. It is very important that I cannot see which user the information derived from, but at the same time would like to access the data and retrieve a list of the users and their respective emails!
User Interface of application:
Here is a screenshot of what the storyboard ideally might look like. Nothing is linked together yet these are just the screens that I originally had in mind! I'm not asking for anyone to give me any serious help as I want to do it on my own, I just need the resources in order to do it myself. It seems as if there is nothing online that could explain how the website parse's framework was created!
STORYBOARD 1: i39.tinypic.com/fbz7n6.jpg
STORYBOARD 2: i41.tinypic.com/dewoau.jpg
How can I make a service similar to parse (JSON format) by using my own server in the cloud?
You can use MySQL on the server and SQLite on the client (preferably wrapped in Core Data) without any issue. The two shouldn't directly interact or have any knowledge of each other. Because the server will present an API for the client to use. And that API should divulge no information about the internal setup of the server.
For the API, think about a RESTful interface, probably implemented with JSON.
This caters for all of your uploading and downloading capability.
Your other things are built around this. You have good intentions for keeping the data anonymous - but that is a facet of what you send and how you structure the data storage in the server.
Finally, doing it yourself will be error prone and take a long time. Creating a Parse.com account and configuring the database will be relatively error free and will take very little time. What do you make money from? (hint: leveraging the work of others).

Database Development - General Structure and Planning [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm about to start a fresh project and I'm good on normalization of the data. My question is the business I'm working for has a number of tables on MS Sql Server and some version of Oracle. Access to create temporary or even use temporary tables may be limited. We might be able to setup our own tables but chances are 50/50. The approach taken in the past has been to create temporary tables as needed for data dumps into MS Access.
If I can edit / create tables on the SQL server then I'm good, but if not I was thinking about setting up one of the spare machines as a MySQL or MS Sql Express server rather than using Access as a number of these types of projects have been completed in the past and push towards a gig in size due to the amount of data downloaded for preparing reports. Would this be a reasonable approach if I'm locked out of MS Sql server or Oracle? What would you do if your hands were tied in a similar fashion?
To provide a little more insight here, the data dumps are often used to build dozens of excel reports (mostly charts). I was thinking if I can use the MS Sql or Oracle to do all the work via triggers / stored procedures / etc. then perhaps I can eliminate the need for Access and just download the data via VBA using Excel only to reduce the amount of time it takes to build the reports.
Maybe I can use an ORM and some kind of VB.net code rather than excel to build the charts faster?
I'm open to suggestions, let me know what you all think and any questions I'll try to answer the best I can
Although setting up a PC with something like SQL Server Express or MySQL often sounds like a great idea, I strongly suggest that you get the backing of your boss before doing something of this nature. Installing unapproved software on inappropriate/unmaintained workstations is often frowned upon with extreme prejudice. Were I to do this at my current place of employment I'm confident I'd be looking for a job as soon as it was uncovered. I completely agree that just about anything is better than MS Access - however, supporting an architecture such as the one you describe, at least temporarily until you can find a better gig, is probably better than unemployment. YMMV.
Share and enjoy.
Actually the most easy solution here would be to continue to use access as a front end, and simply link to the tables on the particular server database system in question. That way you save all the money time and resources of having to pull down and build temporary local tables.
The end result is you get to continue to use Access as a great RAD tool, but enjoy the benefits of the security, performance and scalability of the server based system in question.

Teach an M.B.A. the intricacies of Microsoft SQL Server (and how's it different from MySQL?) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I haven't had to interact w/MSSQL much in my development career, though I've spent many an hour working with MySQL.
An M.B.A. friend of mine is starting a job where she needs to gain functional knowledge of MSSQL Server, and I'd really like to help.
What are the differences between MSSQL and MySQL?
How would you recommend a non-technical person go about learning the ups and downs of MSSQL Server?
[update] Previous database design skills are naught. I've given her to short and long on what a database does from a high-level.
I'd love to say, "you can't". But that would be untrue (or at least mean).
If she has any background with database design at all, then this is merely a new RDBMS.
If she's never done database design, the place to start is not so much with MS SQL, but with how databases work, in my opinion.
Database Design for Mere Mortals is a good place to start. From there I'd move to an MS SQL -specific book, such as Microsoft SQL Server Unleashed.
Download the free SQL Express and start using it. Microsoft also has several video tutorials that would be helpful. They start pretty much from the beginning with "What is a database" and move to more advanced topics.
From the perspective of the database user, the backend is generally irrelevant if they understand some basic concepts.
First and most important concept for the non-technical user is GIGO (Garbage in Garbage out). Bad data is useless data. Check everything you enter into a database for correctness. You really don't want the customer's product to be mailed to San Diego, VA instead of CA.
Then next most important thing is to really understand your user interface and how it works. I've spent a lot of time fixing up junk because users didn't know what they were supposed to put in fields in databases (it would have helped if the developers had not allowed non-email type data to be entered into the email field, but you can't send an email to 757-111-6789). It is never a good idea to put the wrong kind of data into a field because you don't have another place to put it. As a user, you may have no idea what the database is going to use that data for and wrong data can completely stop a process or break something really important. If you don't know what to put in a field, then ask. Don't put junk into a field just because it is required. (Hint, it is required for a reason, that usually means this is data critical to the operation of the database, do not fake this information.)
Now if this person is doing reporting, then the critical concepts become understanding boolean algebra and a very strong undertanding of joins. If you have these two concepts down pat, you have 80-90% of what you need to query a database.
The specifics of the database supported also become important. You need to understand what is stored in what tables (or what views to use) and how they relate to each other. Coming into a new job, I would sit down with the developers if possible and get an overview of the design and whatI would need to know to get the data. I would review existing report queries to see how the data is currently being retrieved and use that to ask questions if I don't understand what the person did. Even a database expert will need to spend some time doing this when faced with a new database, so there is no reason to be shy in asking these questions when you are new.
Final thing is to learn how to report a problem to the developers. Problems that are not reported don't get fixed! Problems that are not reproducable because the user didn't provide screen shots and a context for what she was doing when the error occurred, don't get fixed either. New data fields that are needed as business requirements change, don't get added to the database until the developers know about them (Please ask for a Notes field if you need it instead of entering junk data into a field like email that you personally are not using for instance). New business requirements often require a lot of work in the backend to change how things work, it isn't as simple as adding a field on a form. Please be aware of that too when you make requests.
I learned from Robert Vieira's Professional SQL Server 2000 Programming -- well written and comprehensive. I am pretty sure the 2005 version is very similar, just updated. Despite the 'professional' label, I found it a great intro (I had practically no database experience at the time).
Also I second Erikk's comment. Download SQL Express and PLAY!