table showing from database in web page using JSON PHP - php

Assuming a number of database tables exist on your MySQL server, the html web page must provide the user with the means to choose a single database table and subsequently display this as a table on the same web page without refreshing the whole web page. A drop-down list box is to be used to present the list of available database tables to the user. The drop-down list box contents must reflect the database tables presently available on the MySQL server without further web development amendments i.e. available database table names must not be hardcoded into the web page. This information must be obtained when the document has been loaded and must be returned as JSON.
Please guide me

You can create an api in your server to getList all the database table name. Which will fill up your drop down in the UI.
Create another api which will take tableName/tableId as a parameter. Then get the data from that table. Rest you'll have to figure out.

Related

How to query data from database in a PHP page only once, and use it in multiple PHP pages?

I am making a PHP website containing mulptiple pages and the data I am displaying in those pages is thousands of records/rows coming from a database table.
In each PHP page, a connection is established, a database is selected, a table is selected, and it is queried and data is returned and that data is modified. This identical process is repeated in each of the multiple PHP pages.
Now one option is that one should pass around that huge dataset between pages (using POST?) using
Is there a way to perform the above steps only once in a PHP page and then store that data somewhere temporarily for the session. So that it is available to all PHP pages.
Session variables can be stored in $_SESSION

generate dynamic html pages and store in mysql using php

im doing one simple project for an advertisement agent in php. in that when the admin upload the name,images and description of the product the data need to store in mysql(completed) and a html page need to create for that particular product in that html page the data which is inserted into the database of that particular product need to display. Is that possible? Any refference is there...?
The data you want to display to the user, you can do the task via PHP. Get data from mysql via PHP & display it to the user. Why creating the separate HTML page!
Yes, Possible.
Upload Product image on the server and store images link, name and description in MySQL Table.
In your php script make connection to the database and fetch the data in your php script. After display the data as you want.
PHP CRUD Tutorial (part 1)
File Upload and View With PHP and MySQL

Multiple edit of a database table in one form

ok heres my problem.
I have a database table that i want to edit multiple rows by using one form.
I am looking for a way to be able to display a form in which i will be able to edit the rows and save the entries in a grid view kind of way.
Can this be done by dynamically letting the user choose which fields he wants to edit or provide an excel sheet kind of interface where changes are made and saved to this already existing database table.
Using PHP, if you name the form fields as nameoffield[] they will arrive in the request back to the server as an array. Just make sure empty fields have some place holder when they get sent back to the server and just parse through them one by one performing updates/inserts as necessary.

Dynamic lists (JQuery) and retrieving the data

I have arrived at a wall in my project. I am trying to create a way that a user can add a url to the database (associated with there user id) and then that can be read as a feed (using SimplePie).
I am trying to make it so that the name of the feed (when they add a feed they give it a name) is displayed in a list. And then when they click on the name a drop down appears under the name with all the latest articles from that feed in it.
Does anyone know a way that I can build an order-able list from the urls associated with the current logged in user id and then create the drop down for each individual list item that displays the lastest articles in the drop down.
So far I have managed to create the form for saving to the database and I have created a drop down. I just don't know how to create it all dynamically (depending on how many results are returned depends on how many items are displayed).
Thanks in advance!

Why is the record not showing up in the DB

i am trying to create a custom solution for a client using their prior system. The client is using Miva which is a user friendly CMS type system to manage their store. The problem is prior to yesterday everytime i entered a record in the miva site it would show up in PHPmyadmin and I could query it and use the Custom solution. FOr some reason now when I create products in the admin I get no records in the DB.
The product is clearly there
but not stored in the db, any ideas on how and where is stored
Logic dictates that either:
Your query was wrong
You're querying the wrong database
The website does not relate to the database you're querying
You're asleep and none of this is real.
Are you able to do a wildcard search for something specific like a piece of text or file location? If no errors are being thrown when you're adding items then it should be there.

Categories