Hi, I found a stored procedure that calculates whether a point is in a polygon or outside of it. But, I'm having a little trouble adapting it to my needs.
The stored procedure is called as follows:
SET @point = PointFromText('POINT(5 5)') ;
SET @polygon = PolyFromText('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))');
SELECT myWithin(@point, @...
I am a developer who works full time with wordpress and I came across something in my database which I have never seen before. I tried the normal search engine approach and have found nothing. Wondering if the wonderful people of stackoverflow have seen this before. I am pretty sure it isn't harmful. This is the entry in the mysql da...
I have this SQL by a programmer:
$sql = "
INSERT INTO
`{$database}`.`table`
(
`my_id`,
`xType`,
`subType`,
`recordID`,
`textarea`
)
VALUES
(
{$my_id},
?xType,
?subType,
{$recordID},
?areaText
) ";
My question is why is he using ? before v...
I've been using indexes on my mysql databases for a while now but never properly learnt about them. Generally I put an index on any fields that i will be searching or selecting using a WHERE clause but sometimes it doesn't seem so black and white.
What are the best practises for mysql indexes?
example situations/dilemas:
If a table...
Im on a not so great shared hosting plan. I cant get file privileges for mysql so i cant do SELECT INTO outfile, and i dont have command line access so I cant use mysqldump.
What can I do to get a decent table backup?
...
I have an interesting problem, that i am sure has a simple answer, but i can't seem to find it in the docs.
I have two separate database tables, on different servers. They are both identical table schema with the same primary keys.
I want to merge the tables together on one server. But, if the row on Server1.Table1 exists in Server2....
I have a rails application running for the past 90 days that suddenly stopped working.
Debugging the problem I found that I can read from the DB but not write to it. At least for certain models.
There is one model that I can save whereas all others return Connection refused - connect(2) when I attempt to save them.
They all used to wo...
How can I check if a user exists?
Im doing an installer for a mysql database, and I need to check if a user exits, if not create user, if yes delete user and create it again.
this so i can execute the script without worries.
thanks.
...
I want to fill a CSS box with text till there is no overflow or scrollbar. I fetch text from MySQL. The user clicks a button and the next bit of text that can fit will fill the box. The only way I've figured to do this is by parsing through the text and counting characters and newlines, etc and calculating whether it will fit in the b...
In the past i have granted previlges to users via phpmyadmin by logging as root user.
There was one tab called previleges.
I dont remember now where is that tab.
can anyone tell me how i can get that tab , i need to grant some previleges
...
this is my mysql query.
SELECT s.s_nric AS nric,
s.s_name AS name,
s.s_psle_eng AS psle_eng,
s.s_psle_math AS psle_maths,
s.s_psle_aggr AS psle_aggr,
(SELECT re.re_mark
FROM si_...
I've been working on writing a SQL statement to create a MySQL database with several default options, including default character set and default collate. Is it possible to add syntax to make the default engine type for tables in this database to be InnoDB?
I've been looking through the MySQL manual for v.5.1 and I've found the statem...
Hi all, I am creating a table to display on a web page and that table is populated from data in a MySQL database. I am trying to do a couple of things that are making it difficult for me.
First I am trying to have call the PHP code that exists in a separate file in HTML via JavaScript. I think I have that working right but I am not 10...
Hi, I'm not much of a SQL man so I'm seeking help for this one. I have a site where I have a database for all accounts and whatnot, and another for storing actions that the user has done on the site.
Each user has their own table but I want to combine the data of each user group ( all users that are "linked together" ) and order that da...
I'm running a cron job (every 15 minutes) which takes about a minute to execute. It makes lots of API calls and stores data to the database.
Right now I create a mysql connection at the beginning and use the same connection through out the code. Most of the time is spent making the API calls.
Will it be more efficient to create a new...
Hi
How to search dob in db is in the yyyy-mm-dd strucuture. But i have to compare only with yyyy of the field using mysql.
example:
id dob
1 1999-05-10
2 2000-10-05
I am having only the year 2000 . Now how can i get the record 2000-10-05 using mysql search query.
thanks in advance
...
Here is my original query:
$query = mysql_query("SELECT s.*, UNIX_TIMESTAMP(`date`) AS `date`, f.userid as favoritehash FROM songs s LEFT JOIN favorites f ON f.favorite = s.id AND f.userid = '$userhash' ORDER BY s.date DESC");
This returns all the songs in my DB and then joins data from my favorites table so I can display wich items a...
Hello
I'm building an application with distributed parts.
Meaning, while one part (writer) maybe inserting, updating information to a database, the other part (reader) is reading off and acting on that information.
Now, i wish to trigger an action event in the reader and reload information from the DB whenever i insert something from t...
what is the error in the following mysql statement :
mysql> SELECT columnName FROM tableName WHERE columnName LIKE '%' + @variableName + '%';
...
i have a database and need to automatically optimize this 24 hourly
What should I do?
...