Jump to content

Showing database output on my website?


eduard

Recommended Posts

No. nothing can come before creating the database and table. If you read the tutorials, that's what they have you do first. You can't INSERT into something that doesn't exist. AND FOR THE LAST TIME....PHP HAS NOTHING TO DO WITH DATABASES OTHER THAN BEING ABLE TO CONNECT TO ONE AND GET/SET DATA. that's it. it's not in the database, and the database is not in the PHP. Again, because it can't be stated enough, you ABSOLUTELY must understand how these languages (HTML/PHP/SQL) interact and recognize what a database is. so, again (and again and again and again)...phew....1) create database and table (it's probably just easier to do this in phpMyAdmin) for your products and add fields for every piece of information you want to save about a product (price, description, stock, etc). You've already done this and we've already help you. Please refer to the tutorials and your past threads. Nothing overly complicated about this at all.* http://www.w3schools.com/php/php_mysql_connect.asp* http://www.w3schools.com/php/php_mysql_create.asp2) HTML - create a form that has inputs so that it can submit data to a PHP script to save the information from the form to a database. The form inputs should match the fields you've made in the table.* http://www.w3schools.com/html/html_forms.asp3a) PHP - create a script that takes in a $_POST or $_GET array for submitting form data to the database* http://www.w3schools.com/php/php_forms.asp* http://www.w3schools.com/php/php_get.asp* http://www.w3schools.com/php/php_post.asp b ) PHP/SQL - once you have the form submitting to the PHP script, and you can view all the data, you are ready to write an INSERT query to submit the information to the database* http://www.w3schools.com/php/php_mysql_insert.asp---after that's all done, and you've gotten that process to work and have saved a few products, you should see them show up in phpMyAdmin, as you add them4) PHP/SQL/HTML - create a PHP file that SELECT's records (products) from your table and outputs them to the browser in the form of HTML markup* http://www.w3schools.com/php/php_mysql_select.asp
If you read a book you don´t read blank pages? So this file is just like the text of a book! Nothing more!
Link to comment
Share on other sites

  • Replies 72
  • Created
  • Last Reply
That doesn't make sense, you don't use a PHP file "in the database". You use PHP files to interact with the database.Have you created the database yet? Have you created the product table yet? You need to do both of those first. What you are showing is not creating a database or table. You create the database and table inside phpMyAdmin, or you use CREATE DATABASE and CREATE TABLE queries to set them up. Creating your database and tables is step #1 before you can use either of them. You can't use something you haven't created yet.In other words, all of the information we give you is after the database is created. You need to create everything first, then add data to it. You don't add data when you create it, you add data after.We already spent a lot of time with you talking about creating these, so people assume you've already done that.
So the error was I should have used html!
Link to comment
Share on other sites

If you read a book you don´t read blank pages? So this file is just like the text of a book! Nothing more!
yeah...um whatever that means.if you mean that the database is a book and your files are text, well then all you've done is just make a poor analogy.
Link to comment
Share on other sites

So the error was I should have used html!
you need to create a database and table, and then you create an HTML page with a form. that form connects to a PHP script which inside itself takes the form data, connects the database and table you ALREADY made, and then attempts to INSERT it.
Link to comment
Share on other sites

That doesn't make sense, you don't use a PHP file "in the database". You use PHP files to interact with the database.Have you created the database yet? Have you created the product table yet? You need to do both of those first. What you are showing is not creating a database or table. You create the database and table inside phpMyAdmin, or you use CREATE DATABASE and CREATE TABLE queries to set them up. Creating your database and tables is step #1 before you can use either of them. You can't use something you haven't created yet.In other words, all of the information we give you is after the database is created. You need to create everything first, then add data to it. You don't add data when you create it, you add data after.We already spent a lot of time with you talking about creating these, so people assume you've already done that.
I KNOW YOU DON´T CREATE A DATABASE LIKE THIS, BUT A DATABASE NEEDS DATA! THAT´S ALL!
Link to comment
Share on other sites

wow, what a surprise this thread has gone off the rails... maybe it's time to shut this one down too? :)

Link to comment
Share on other sites

I KNOW YOU DON´T CREATE A DATABASE LIKE THIS, BUT A DATABASE NEEDS DATA! THAT´S ALL!
but you still NEED TO CREATE THE DATABASE AND THE TABLE! There's no point doing anything else until you've done that FIRST. :)
Link to comment
Share on other sites

If you read a book you don´t read blank pages? So this file is just like the text of a book! Nothing more!
To follow your analogy, yes, you don't read a book having blank pages.However, think about how the book was written. You don't write a book in the air and then put it on paper. No. You get blank papers and you start writing on them.Well... that was the case in ancient times at least. In more modern times, you don't type a book's contents in air, you type them within a text editor after that text editor creates a blank page for you on screen to write on.It's the same with a database (well, at least as far as THIS analogy is concerned; it's very different in most other cases). The "data" is like the words in a book. Each "table" in a database is like a page in a book. And the "database" itself is like a book.
Boen explained the whole process very clearly. Previously, I was going to pull up one of those graphic illustrations of HTTP requests, but I couldn't find a good image. Boen, didn't you link to an image of the whole process once? I can vaguely remember it. Hmm, maybe it was Synook...
Yes, it was me, but frankly, the last thing I want is for Edward to start questioning me about that other language that was included in the diagram (No! Don't say it!; Edward, you don't need to know; if you really want to know, search this forum for my posts that say "diagram" and you'll eventually find it).
Link to comment
Share on other sites

yeah...um whatever that means.if you mean that the database is a book and your files are text, well then all you've done is just make a poor analogy.
A book is a book and a database is a database!
Link to comment
Share on other sites

To follow your analogy, yes, you don't read a book having blank pages.However, think about how the book was written. You don't write a book in the air and then put it on paper. No. You get blank papers and you start writing on them.Well... that was the case in ancient times at least. In more modern times, you don't type a book's contents in air, you type them within a text editor after that text editor creates a blank page for you on screen to write on.It's the same with a database (well, at least as far as THIS analogy is concerned; it's very different in most other cases). The "data" is like the words in a book. Each "table" in a database is like a page in a book. And the "database" itself is like a book.Yes, it was me, but frankly, the last thing I want is for Edward to start questioning me about that other language that was included in the diagram (No! Don't say it!; Edward, you don't need to know; if you really want to know, search this forum for my posts that say "diagram" and you'll eventually find it).
What I am doing now is following the steps you wrote me (and help me!) to create first a database and then create a table (I saved it in my bookmarks!)
Link to comment
Share on other sites

Thank you folks, y'all have really provided quality developer entertainment. There is no prejudice on my part I just believe this thread might go a lot smother if you provided us with some of what you created or at least tried to create. A screen shot even.

Link to comment
Share on other sites

No. nothing can come before creating the database and table. If you read the tutorials, that's what they have you do first. You can't INSERT into something that doesn't exist. AND FOR THE LAST TIME....PHP HAS NOTHING TO DO WITH DATABASES OTHER THAN BEING ABLE TO CONNECT TO ONE AND GET/SET DATA. that's it. it's not in the database, and the database is not in the PHP. Again, because it can't be stated enough, you ABSOLUTELY must understand how these languages (HTML/PHP/SQL) interact and recognize what a database is. so, again (and again and again and again)...phew....1) create database and table (it's probably just easier to do this in phpMyAdmin) for your products and add fields for every piece of information you want to save about a product (price, description, stock, etc). You've already done this and we've already help you. Please refer to the tutorials and your past threads. Nothing overly complicated about this at all.* http://www.w3schools.com/php/php_mysql_connect.asp* http://www.w3schools.com/php/php_mysql_create.asp2) HTML - create a form that has inputs so that it can submit data to a PHP script to save the information from the form to a database. The form inputs should match the fields you've made in the table.* http://www.w3schools.com/html/html_forms.asp3a) PHP - create a script that takes in a $_POST or $_GET array for submitting form data to the database* http://www.w3schools.com/php/php_forms.asp* http://www.w3schools.com/php/php_get.asp* http://www.w3schools.com/php/php_post.asp b ) PHP/SQL - once you have the form submitting to the PHP script, and you can view all the data, you are ready to write an INSERT query to submit the information to the database* http://www.w3schools.com/php/php_mysql_insert.asp---after that's all done, and you've gotten that process to work and have saved a few products, you should see them show up in phpMyAdmin, as you add them4) PHP/SQL/HTML - create a PHP file that SELECT's records (products) from your table and outputs them to the browser in the form of HTML markup* http://www.w3schools.com/php/php_mysql_select.asp
Thank you very much!
Link to comment
Share on other sites

I will tell you something! (but I´ve written this before!). I am now not in a ´normal´ situation! I am now very stressed! I wrote the previous time that I will explain this AFTER my website is finished! So, I hope you will excuse me if I ask another ´stupid´ question!

Link to comment
Share on other sites

I will tell you something! (but I´ve written this before!). I am now not in a ´normal´ situation! I am now very stressed! I wrote the previous time that I will explain this AFTER my website is finished! So, I hope you will excuse me if I ask another ´stupid´ question!
We don't mind you asking stupid questions. What we do mind is you asking the same question over and over again, even after we've provided you with answers.If you don't understand the answer, tell us what you do understand, and let us try to fill in your knowledge gaps, similarly to the book metaphor above, and if you still don't get it, retell us what your knowledge is so that we can further paraphrase the things you don't seem to get.
Link to comment
Share on other sites

If I ask the same questions means that my mind doesn´t work right! That´s exactly the case when someone is (very) stressed!

Link to comment
Share on other sites

If your mind isn't working right, then you're not going to be able to learn right. Maybe you should put this on hold until you are less stressed and can take the time to learn. It doesn't sound like you have time right now.

Link to comment
Share on other sites

If your mind isn't working right, then you're not going to be able to learn right. Maybe you should put this on hold until you are less stressed and can take the time to learn. It doesn't sound like you have time right now.
Although I completely agree with this advice, it has become clear from Eduard's history that the desire to learn has come from the sole motivation of needing to make money, which has forced him to try and learn things beyond (currently) his scope of comprehension, without taking the adequate amount of time to learn it slowly and properly. This seemingly has added to the stress level (as evidenced by his posts/attitudes/responses to helpful board members) and rather than take the advice we often give him of taking it slow, reading and reading and practicing, he has continued to plow head first into the material with intent on making it work now, and learning it later. Unfortunately, there is no substitute for comprehension and understanding, and the irony is, is that realizing that time and patience are required to learn complex subject matter, Eduard could work on trying to make money with something else in the short term, and make web development his long term goal (~ 2 years from now), which is what most professionals do anyway, be it through education or LOTS of practice, they still have to pass the time someway. You can't force skill/talent, Eduard, and there are no shortcuts to success.
Link to comment
Share on other sites

I am very tired now, but a few things!I am aware that I am not good in web development (I am not accurate enough!)I prefer web design, but there are too many!Yes, it´s a fact that I need money urgently! But that´s the problem because there is a lot of discrimination here (I am disabled!) Besides my family is fed up in supporting me!I discussed this in January with thescientist annd I decided to design a website with a database.

Link to comment
Share on other sites

No. nothing can come before creating the database and table. If you read the tutorials, that's what they have you do first. You can't INSERT into something that doesn't exist. AND FOR THE LAST TIME....PHP HAS NOTHING TO DO WITH DATABASES OTHER THAN BEING ABLE TO CONNECT TO ONE AND GET/SET DATA. that's it. it's not in the database, and the database is not in the PHP. Again, because it can't be stated enough, you ABSOLUTELY must understand how these languages (HTML/PHP/SQL) interact and recognize what a database is. so, again (and again and again and again)...phew....1) create database and table (it's probably just easier to do this in phpMyAdmin) for your products and add fields for every piece of information you want to save about a product (price, description, stock, etc). You've already done this and we've already help you. Please refer to the tutorials and your past threads. Nothing overly complicated about this at all.* http://www.w3schools.com/php/php_mysql_connect.asp* http://www.w3schools.com/php/php_mysql_create.asp2) HTML - create a form that has inputs so that it can submit data to a PHP script to save the information from the form to a database. The form inputs should match the fields you've made in the table.* http://www.w3schools.com/html/html_forms.asp3a) PHP - create a script that takes in a $_POST or $_GET array for submitting form data to the database* http://www.w3schools.com/php/php_forms.asp* http://www.w3schools.com/php/php_get.asp* http://www.w3schools.com/php/php_post.asp b ) PHP/SQL - once you have the form submitting to the PHP script, and you can view all the data, you are ready to write an INSERT query to submit the information to the database* http://www.w3schools.com/php/php_mysql_insert.asp---after that's all done, and you've gotten that process to work and have saved a few products, you should see them show up in phpMyAdmin, as you add them4) PHP/SQL/HTML - create a PHP file that SELECT's records (products) from your table and outputs them to the browser in the form of HTML markup* http://www.w3schools.com/php/php_mysql_select.asp
Could you explain 2 please? (html page with php script?) Sorry, I didn´t see the link!
Link to comment
Share on other sites

what do you mean you don't see the link? Have you read the HTML tutorials? You have to be able to make a form to submit to a PHP script. First part of that is knowing how forms work and how to make one.http://www.w3schools.com/html/html_forms.asp

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...