I have an array of employee ids:
34 , 35, 40, 67, 54 and so on.
What would be the simplest way to query my 'employees' table and find all the names of the correlated employees?
That is a query that would return the 'name' for each of the ids in the array.
...
i had no problem at all running the following code on a local server, but when i run it from phpmyadmin on a yahoo hosting webserver, i am getting this error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALGORITHM=UNDEFINED DEFINER=root@loca...
I am developing a personal PHP/MySQL app, and I came across this particular scenario in my project:
I have various comment threads. This is handled by two tables - 'Comments' and 'Threads', with each comment in 'Comments' table having a 'thread_id' attribute indicating which thread the comment belongs to. When the user deletes a comment...
Every single book that teaches programming (or almost anything else) starts off with a whole bunch of spiel on why what it's about (C++, mysql, waterskiing, skydiving, dentistry, whatever) is the greatest thing in the world. So I open the MySQL O'Reilly book, and read the intro, and get the traditional sermon. The main points that the bo...
I have two tables, Games and Teams. What should my sql statement look like to make a list of games that pulls in the TeamName that is linked to the TeamID1 and TeamID2 fields? I believe I could use a left join but I'm not sure what to do with two foreign keys that link to one primary key. Thank you very much for any help you could provid...
Im making a registration script for my site and i want to check if $_POST['username'] does already exist in db.
Is there a better, less code way of doing it? I do the same for email.
This is how it looks like now:
$checkusername = mysql_query("SELECT username FROM users WHERE username = '$_POST[username]'");
$row83 = mysql_fetch_assoc...
I have the following MySqlCommand:
Dim cmd As New MySqlCommand
cmd.CommandText = "REPLACE INTO `customer` VALUES( ?customerID, ?firstName, ?lastName)"
With cmd.Parameters
.AddWithValue("?customerID", m_CustomerID)
.AddWithValue("?firstName", m_FirstName)
.AddWithValue("?lastName", m_LastName)
End With
I have a class that handles e...
ms-access is connecting to a local mysql database
the following code returns an error:
Public Function run_sql(strSql As String)
On Error GoTo lblError
CurrentDb.Execute strSql, dbFailOnError
lblExit:
Exit Function
lblError:
MsgBox Err.Number & ": " & Err.Description
Resume lblExit
End Function
strSql = "DELETE FROM tblUs...
i have this problem:
http://stackoverflow.com/questions/1355234/ms-access-could-not-delete
and i found a potential solution here:
http://support.microsoft.com/kb/240098
however it asks me to follow these steps:
Open the delete query in Design view.
On the View menu, click Properties.
Set the UniqueRecords property to Yes.
Save the ...
I have three tables of information where the business_id is the common thread. I have two input fields, one for general search (users can search for whatever they want) and a zip input. On the php side, I catch the general search string and set it to $search and the zip set to $zip.
How can I use the $search variable to MATCH any of th...
Mysql's environment is following:
character_set_database="big5"
And when I send a SQL which contains tranditional Chinese
(such as "select * from a where name =
'中')
from jdbc to mysql database, it will throw the following exception:
Illegal mix of collations (big5_chinese_ci,IMPLICIT), (latin1_swedish_ci,COERCIBLE), (latin1...
I'm stumped. Why would a query work in phpMyAdmin but not in a MAMP environment? I've echoed out the query, which returned 0 results in MAMP, copied it and pasted it into phpMyAdmin and the same query returns the expected result.
select
c.id
from
(select id, business_id
from coup
where match(name) against ('$search')...
I currently have an array of values (business_id's)
lets say its
Array
(
[0] => 12
[1] => 14
[2] => 15
)
What is the best way to use each of these value to get the associated row information for each business_id from the database.
Can it be one in one query is my question. Obviously, you could do
$q = "select * from business where...
I have a category table with id,name,parentid.
id------name------parentid
1 a 0
2 b 0
3 c 1
4 d 1
5 e 2
6 f 2
7 g 2
8 h 2
9 i 0
I want a single query to display the result in the fol...
I'm using Zend Framework with the PDO MySQL adapter and I want to use a function in my insert statement. Basically, the SQL I want to generate is this:
INSERT INTO `myTable` (`leftId`, `rightId`, `date`) VALUES ($left, $right, NOW())
This is the code in my Model:
$data = array(
"leftId" => $left,
"rightId" => $right,
"dat...
I'm trying to get values that equal both b.business_id = 22 and l.zip = 91326. The easiest thing for me to try was select l.*,b.name from buslocations AS l left join business as b where b.business_id = '22' and l.zip = '91326' but apparently there is something wrong with that. Any assistance with the correct syntax for two defined valu...
When developing an application which mostly interacts with a database, what is a good way to start? The application requires a lot of filtering based on user input, sorting and structuring.
...
I have an existing JSP website which I would like to painlessly add CMS functionality to.
The site is a intranet portal and is backed by a database etc. however some pages like News and Events etc. I would like the user to be able to edit using a simple CMS. I would also like the user to be be able to create new pages and put them into...
I want to change the data type of multiple columns from float to int. What is the simplest way to do this?
There is no data to worry about, yet.
...
I'm trying to connect locally to mysql 5 server in jsp page using tomcat 6 and datasource.
I've configured everything as in the tomcat manual (web.xml, context.xml, etc.), but I get this exception:
java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve)
...