Can PHP use a MySQL bookmarked Query? [closed] - php

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 haven't found anything that matches my situation...
I am using XAMPP, which has MySQL as a backend and PHP in the front (web) end. in the Administration screen of MySQL (phpMyAdmin) I can create and run SQL requests. There is also an option of "Bookmark this SQL Query: "
Suppose i save a "Bookmark SQL Query". Is it possible for PHP to reference this Bookmark SQL Query? or do I have to create that query in PHP. It would be easier to reference the Bookmarked query, rather than make the full SQL query
Thanks.
Thanks to those who understood the question. You are smarter than those to didn't.

PHPMyAdmin is simply a PHP application that interfaces with your database. Anything you save on it stays on it.
Your PHP application is completely different from PHPMyAdmin and unless you create such a feature, you cannot use it within your application.
If you create a SQL execution interface within your application, you can also create something like that to be able to re-use the query.
Hope the explanation makes sense and the answer helps.

No, I don't think it's possible, the feature you're talking about is a feature in the client application only. You should write the query in PHP. That way you don't have to rely on an external feature/query for the application to work either.

Related

Databasing in Ruby [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 7 years ago.
Improve this question
I'm making a website for a group that needs a database. The data is going to store user information among other things. I already know PHP and could easily do it in PHP, but to further myself as a developer, I'd like to learn a language like Ruby. I know how to use databases in PHP. But, when writing Ruby, can I use SQL databases?
We don't know how you call your database in PHP.
Many PHP users use MySQL and call sql statements with the embedded mysql driver,
and then iterate over the results.
You can do this also in Ruby. The mysql driver is not embedded, But you can easily install it with RubyGems. You need the mysql2 gem.
https://github.com/brianmario/mysql2
But if want to be more object-oriented, there is the framework "Ruby On Rails" with "ActiveRecord" for database connection. Here you don't write SQL directly, instead you specify what objects you want to have or store (except in rare edge cases, where you still can write sql)
This needs some learning time. But then it is lot less coding, code is better readable, and security errors like are also easier to avoid.
The basic answer is yes - you can do something like that using Ruby and a framework like ActiveRecord or Sequel, but this far too broad for StackOverflow.
Good afternoon.
Depends on the speed you need .
1) If you need quickly - write on PHP
2) If you have some time and want learn Ruby On Rails, ActiveRecord etc. ... buy some book for beginner, read doc and step by step create application

Adjusting to ASP from PHP [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 8 years ago.
Improve this question
I'm in the process of learning ASP.NET and I'm having a few difficulties with certain things. The main difficulty I have right now is accessing data from a database. Usually in PHP in the model I'd just write an SQL query for a specific model function and then that'd query the DB and return the results I want to the calling controller. Is doing this fine in ASP MVC? And if so how do you do it? The tutorial I was following started using scaffolding and I want to avoid that as I want to fully understand how it all fits together.
I myself started in PHP and gradually moved to .NET. The way I manage my database is via Entity Framework. I know it may sound like you've got to learn yet another useless thing, but it is actually very simple. If you just want to learn the concept: use code first approach.
This is how it works: you create a bunch of models (that you will need anyway its called Model-View-Controller for a reason) that are nothing but objects. Those models are used to build your database. So you no longer need to set up the database manually (e.g. phpMyAdmin). It sounds quite amazing but that's how it works and then you use LINQ (or LINQ-to-SQL) to get queries.
This an example of a LINQ-to-SQL query:
var query = from u in dbContext.User where u.UserID == 1 select u;
This will come useful later on as well when you want to validate information etc. Here is a great starting tutorial (just watch the first 4 of those videos):
https://www.youtube.com/watch?v=Z7713GBhi4k&list=PL6n9fhu94yhUPBSX-E2aJCnCR3-_6zBZx
Moving from PHP to .NET is a big move, but it is really worth it.
Good Luck!

virtual pages using PHP only? [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 8 years ago.
Improve this question
I am working on a project that I need to let users to create pages on my server. however, I do not want to let users clutter my mysql database by storing the stuff in there so I cannot use mysql database for creating the pages.
I did research this topic and there seem to be a some sort of a plugin for WP that will allow virtual page creation.
is this possible using pure php WITHOUT the use of any database ?
It's possible, but wrong.
You can use php to write a html file to your web directory, sure. But that
solution is in no way cleaner or less cluttered than putting stuff in your
database, for a few reasons:
It's easier to have structured information in the database
It's a good thing conceptually to separate user data from your program
It's easier to control access to your database in a safe way, compared
to writing user data to the file system
"I really do not want to use mysql database" is not a good reason to give this
up. You might have a good reason, but it's not easy to guess what that is, which
makes suggesting alternatives very difficult.

MongoDB and PHP - use the MongDB for user login or not [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am planing to create a project in PHP which will be connected with MongoDB due to the MongoDB flexiblity. The goal is to store in the MongoDB some documents that can vary during the time and with MongoDB we can add extra data without changing the structure of the DB, which is not the case with MySQL.
My question is: Is it a good idea to use MongoDB as the unique DB, or should I use it together with MySQL. The MySQL for the data as user login info etc, and the MongoDB for documents.
I am planning to use the Symfony2 framework or the CakePHP.
Thank you in advance.
I think it's a good idea to use MongoDB as the unique DB. It's a lot easier to use one database and MongoDB can handle the user login info just fine. You may want to change some collections over to MySQL in the future though.
MongoDB is pretty new compared to MySQL so it does have some drawbacks. For one, MongoDB is not as reliable as MySQL so your bound to run into a few bugs. It will also be harder to find answers to your questions as MySQL is far more popular.
MongoDB is great, but you must make sure you have the time to get to know it. If your short on time or are making it for a client, MySQL is probably a better option.
If a single DB server can handle the job, I'd stick to MySQL. The frameworks you are going to use have this DB in mind.

retrieving datatbase information on a web 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 9 years ago.
Improve this question
This will be a total novices question, but I am looking for advice.
My apologies, In the post as I failed to mention that the database that I am working on is MySQL.
I know absolutely nothing in regards to any technologies that retrieve or get information from a database. The only 3 facts that I know is that it can be done by either PHP or HTML5, I should be able to pick it up and that I will make many mistakes
Could the community suggest which would be the better technology to learn and would any be able to suggest a starting point?
Yours in advance
Keith
In order to retrieve database information, you generally only need a database such as MySQL - and a client to perform your queries (fetching data from the database).
Your client could be anything, a commandline tool or a PHP script opening a connection to your database and performing the desired queries.
Fetching data alone will not get you very far unless you can display that information somewhere, or even provide access to it or (if desired) allow users to interact with it.
Basically, if you want to retrieve database information and show it on a website, your minimum requirements would be HTML, a database server, a database (preferably with some data to run some tests with) and some kind of scripting language (such as PHP).
There are numerous tutorials out there on how to make your first steps with this.
Here is one.
Start with PHP + MySQL. There are a lot of manuals and examples over the Internet. Google it.

Categories