I am trying to set up a MySQL connection in a main script, and then call various functions depending on what I want to do. I am having trouble passing the connection information to the function.
I have a class "queries" which contains various functions, all which return an array. This is what the code looks like in my main script (calli...
I'm stuck with the following query, it partially seems to work before giving up the ghost. I'm no guru but I'd be grateful for any help offered.
I have two tables
cms_tags
key | tag | timesused
---------------------------
1 retriever 12
2 jack retriever 1
3 energetic 5
4 bulldog 3
...
Hi I'm trying to create a search box to search customer by last name and/or first name and/or phone number.
Here is my SQL Query:
SELECT *
FROM customer
WHERE Match(c_fname,c_lname,c_phone) Against('$keywords')
My questions is Why does it work when i search for bill and not if i search for bob?
Another question is how do i prio...
Hi,
Is there a way to return LatLng, Google Maps' format for points, from a mySQL database? I'm using Flex 3 and MySQL with Google Maps.
Currently, I select latitudes and longitudes from my mySQL table and then iterate over them in Flex in order to make the LatLng for Google Maps.
public function latLngCreator():void {
myLatL...
I am using mysql and the following two sqls produce different result.
SELECT developers.* FROM "developers" ORDER BY id DESC LIMIT 1
SELECT developers.* FROM "developers" ORDER BY 'id DESC' LIMIT 1
I thought that quoting order by should not matter.
...
what's the purpose/point of the REAL() Datatype in mysql? You have float,double and decimal which i understand but where does the "real" datatype come into it? Any ideas?
Thank you in advance ;-)
is real the same as float or double?
...
This is a simple query ran when the user presses logout from my website
UPDATE `user_logins`
SET `active` = 0
WHERE `user_id` = 3
AND `datetime` = MAX(`datetime`) LIMIT 1
The user_id value is binded in there with PDO.
I get the following exception thrown
Invalid use of group function
Googling around seems to say that ...
Hi,
I'm kind of stumped.
I have a table of items with fields: ID, title, created_by, group.
I also have another table of groups with fields: ID, created_by, group_name
and a final table of users with fields: ID, username, password etc.
The idea is that only items created by the logged in user or items where the logged in user i...
I have a database that I need to maintain in both oracle and mysql. The data insert script of scripts looks like below. Of course Mysql uses source while oracle uses @ In all other respects the scripts invoked and their order of invocation are identical. (That's because they are just ANSI compliant insert statements).
Is there anyway ...
Hiho!
I need some help.
I use this SQL to check for previous / next threads.
$prev=SELECT MAX(id) as prev_thread_id
FROM threads
WHERE id < $threadid
AND forumid = $forumid
$next=SELECT MIN(id) as next_thread_id
FROM threads
WHERE id > $threadid
AND forumid = $forumid
How would I do to check if theres a previous thread and then pri...
Hello,
I am using sessions to pass user information from one page to another. However, I think I may be using the wrong concept for my particular need. Here is what I'm trying to do:
When a user logs in, the form action is sent to login.php, which I've provided below:
login.php
$loginemail = $_POST['loginemail'];
$log...
This has been always a problem for me , Character problem . I always tried to solve my problem with little patches , actually this never solves my problem in reality.So I am looking for very strong solution to solve all these problems.I want to learn how big apps(facebook , google, other multi lingual ajax apps and apis) solve this probl...
Hi,
I've got a mySQL query that produces an empty set. For example,
SELECT id
FROM `my_table`
WHERE type = 'old'
AND neighborhoods = 'Newport'
produces an empty set. In the event that the query produces an empty set is it possible to have it return:
id
---
0
Thank you.
-Laxmidi
...
Hi!
I'm trying to change a database entry with PHP but is stuck with this error message:
Error: 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 'Bjelkholm Lövgren AND adress =
Brinellgatan 14 AND postnummer = 57135
' at line 1
Code:
...
So, I need some code help.
I've got an awkward little MySQL table that just keeps growing and growing.
Let's assume that a set of clients, some in certain countries, that I need to 'total' the invoices for (need to calculate GST)
So, two tables contain the data I need -- one table has their ID and their country (In this case, Canada!)....
When I do a query for NOW() mysql returns a time that is off by roughly -30 seconds from the current time on the server. Any ideas? I tried looking through the config file and found nothing. I'm running version 5.1.37
SELECT NOW()
...
I just came across a requirement of labeling a user as 1 of 3 different roles. Normally I have used an id, but the roles don't really relate to each other at all.
I had a look at the set datatype, and I added the 3 different options.
Will the database internally just store the index of the set, e.g. if the set is set('a', 'b', 'c') an...
I'm trying to update a database entry but it won't change anything. I'm getting no errors which confuses me...
Code:
if(isset($_GET['edit']))
{
$idn = $_GET['id'];
$namn = $_POST['namn'];
$adress = $_POST['adress'];
$postnummer = $_POST['postnummer'];
$postort = $_POST['postort'];
$email = $_POST['email'];
$...
How can i run mysql and or query together instant of separate query.
e.g.:
And query:
select * form tablename where name='A' and password="A" and id='A';
Or query:
select * form tablename where name='A' or password="A" or id='A';
-These are 2 different query,can i make these query together?what is the syntax??
...
hi there,
i have a table that looks like this:
Field: msg_sent_datetime
Type: datetime
yet when i use NOW() in a php mysql insert query it is staying as all zeros?
any idea why?
...