I’m working with an existing database that has first name and last name seperated in the database. I need to create a function that will take one search input and return results. say my database has a structure like…. How could I, using MySql, take a search input that is say ‘Joe Smith’…
Tag: mysql
Phpmyadmin export VIEW without DATABASE_NAME or ALGORITHM
When exporting a sql dump with phpmyadmin it creates the VIEW table like this: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `database`.`table` etc.. Each time I …
can not access to database in moodle
I am using moodle and I change location of my web site, but I am facing this error. My config.php is: And my error is: Error: Database connection failed. It is possible that the database is overloaded or otherwise not running properly. The site administrator should also check that the database details have be…
How to enable php extensions and database support?
After spending some time in setting up a local sever in mac os, installing php5, and finally installing mysql I am still running on problems when trying to perform an drupal install. When going to …
How can I make my Live Feed list update only on the active tab or update it when the tab becomes active again?
I have a Live Feed jQuery box which updates in every 10 seconds, and puts the sites latest comments on top. This is working fine: jQuery makes an Ajax request, calls a PHP, which returns new items or …
Parse JSON To Create SQL Insert Statements in PHP
I’m a newbie programmer trying to find my way in the world. I’ve got my hands on JSON data that I’m trying to parse out into SQL statements to populate multiple database tables. I would like to loop through each dimension of the array and pull out specific parts of it to create an INSERT sta…
Submitting a form using
I’m having a little trouble with this and can’t see what I’m doing wrong. I have this form: So when the user clicks the button it should submit the form then have this PHP to act upon the form (I know that the sql isn’t a prepared statement and is vulnerable to injections but this will…
PHP/MySQL: Get name for specific ID
I am a beginner to MySQL and Im trying to retrieve a name for a specific ID. Here is how my database looks like: I have a table of contacts which contains ID, first and last name. I want to retrieve the first and last name for a specific ID in the same form. So I want to end up
Completely arbitrary sort order in MySQL with PHP
I have a table in MySQL that I’m accessing from PHP. For example, let’s have a table named THINGS: things.ID – int primary key things.name – varchar things.owner_ID – int for joining with another table My select statement to get what I need might look like: SELECT * FROM things W…
Resetting array pointer in PDO results
I’m having trouble moving from MySQL SELECT methods to PDO methods. I want to iterate through a fetched array twice, both times starting with row zero. In MySQL I would use: Using PDO methods, I’m not sure how to accomplish the same thing. The code below is how I am trying to do this. The first wh…