mysql

Sorting union queries in MySQL

I am making a search feature for a Job listing website. For that I need to first show the listings with matching titles and then the job listings with matching description. Here is the query, I am using right now: Example: (SELECT * FROM `jobs` WHERE title LIKE '%java%developer%') UNION DISTINCT (SELECT * FROM `jobs` WHERE descriptio...

How to upload Excel or CSV to MySQL data base using PHP?

I have an Excel file containing data(list of Phone numbers), and i want that data from, Excel file to be imported in to my Database table(for example called phonenumber_list) using PHP code? i know how to convert MySQl in to Excel, but can it possible in reverse? Please Help! ...

Joins in SQL for retriving data from two tables

There are two tables A and B. You are retreiving data from both tables where all rows from B table and only matching rows from A table should be displayed. Which of the following types of joins will you apply between A and B tables? - Inner join - Left outer join - Right outer join - Self join ...

drope table mechanism in sql

When a table is dropped using a simple DROP statement, SQL performs some more operations simultaneously, select all the valid operations? a. Removes all rows from the table b. Drops all the table's indexes c. Removes all dependent views d. Removes all dependent procedures ...

Storing the result of a dynamic text field into separate database fields

I am working within the confines of a php based CMS like system, which defines custom form fields that can be used when making a new page. I have two tables in my database, one called people, which has three fields, firstname, middlename and lastname, and a second table called orders, which also has firstname, middlename and lastname fi...

select the rows affected by an update

How can you get the exact rows affected by an SQL UPDATE statement in MySQL? I have many clients on many computers that can be updating rows in the same table based on WHERE clauses at any time, and each client needs to do something in another system for each row that they affect, so getting the list of affected items must be accurate a...

MySQL: Insert record if not exists in table

Hi, I am trying to execute the following query: INSERT INTO table_listnames (name, address, tele) VALUES ('Rupert', 'Somewhere', '022') WHERE NOT EXISTS ( SELECT name FROM table_listnames WHERE name='value' ); But this returns an error. Basically I don't want to insert a record if the 'name' field of the record already exists in a...

generated StoredProcedures.vb class is empty

Hi, i've added to my MySQL database, 2 stored procedures, then generated data access classes using the Subsonic Tool in visual studio... i notice that the StoredProcedures.cs class is empty.. why is that? and what do i do now? how will i use my stored procedures i my application? im using subsonic 2.1 and mysql administrator 5.0.. pl...

MySQL attempting to delete all rows which are not constrained by foreign key.

Okay, this is (probably) a very simple question, but I am afraid I know almost no MySQL, so please put up with me. I'm just trying to delete every row from one table which is not constrained by a Foreign Key in another table - a specific table, there are only two tables involved here. The create statements look a bit like: CREATE TABLE ...

Execute multiple sql delete query in mysql for php

For some reason, i want to delete some of records in my table using php mysql query function. Here's what i've write $sql = "delete from progress where first_date='2010-01-01' and last_date='2010-01-31'; delete from progress where first_date='2010-02-01' and last_date='2010-02-28'; delete from progress where first_date='2010-03-01' and ...

Mysql table architecture suggestion needed

Existing system - I have existing Users and Tutor_Details tables in my system. - There are two types of users - tutors and students. Users and Tutor_Details tables are linked by id_user foreign key. New requirement - Every tutor can have some of the following credentials:- Certified Experienced Other A tutor can have a maximum of 3 a...

Content of form element not being saved to database while others are

I am working with a CMS like system, phpBMS, which defines a certain way of making forms, and defines the form elements to be used in such forms. This is an example of the form template, and these are the fields that are defined. Generally, it is pretty simple. If you have an inputField with the id of say, 'name', the content of that f...

HOw to send an email from PHPmyadmin DB using the Stored procedure

Hi All, I want to send mail using stored procedure using the My SQL in the PHPmyadmin regards, hemant ...

Learning Management System using php codeigniter?

Is there any open source Learning Management Softwares that is developed using php codeigniter? a Web based software for delivering,tracking and managing training/education that focuses mainly on Class/session scheduling, Class enrollment/registration, Teachers/Trainers,Students and Lessons/Courses/Categories/Evaluation I'm a BSIT stu...

how to Create simple stored procedure which returns resultset in mysql

Create simple stored procedure which returns resultset in mysql ...

Allowing the creation of custom forms and storing the data

I'm building a site and need to allow users to be able to create custom forms. The part I'm having trouble with is how to store the data from these forms. Since they are user created fields, there will be no corresponding field in the database. What would be the best way of going about this? I assume modifying the table is the incorr...

MySQL: Join two tables

Hello, I'm having problems with design correct SQL query. I'm tired like a hell today, been working over 12 horus (deadline soon) and cannot find issue... Tables: buddies | userid | buddyid users | id | username Now, what I'd like to do: Query table buddies for all user friends (when ID = userid OR ID = buddyid). Having no problems ...

MySql Join a View Table as a Boolean

I have a users table, and a view table which lists some user ids... They look something like this: Users: User_ID | Name | Age | ... 555 John Doe 35 556 Jane Doe 24 557 John Smith 18 View_Table User_ID 555 557 Now, when I do run a query to retrieve a user: SELECT User...

Match a field from a form's contents with a table in a database (MySQL)

I have set up a form on my site. And I'm wondering, how can I match what people enter in a field in that form with something in another table. The form submits to one table, and I want to check if what's submitted with the form is in another table. In this case, I have a field named "Title", and I want to check if what's been entered fr...

How does one implement a MySQL database into a webpage?

I am a complete database newbie. So far, I know that I can connect to MySQL using PHP's mysql_connect() command, but apart from that, I really don't see how to take that data and put it onto a web page. a) are there ways other than mysql_connect() b) lets say I had a table of data in mysql and all I wanted was for that table (for examp...