Hi,
Does anybody know what the performance of using substring in MySQL is like? I have some insert and update calls where I have to truncate all the fields (up to around 15) using substring statements. These will get call pretty regularly so I'm a little worried about performance.
...
Hi,
I'm running XAMPP on my local host, and i want phpmyadmin to add another field of server on login page, so i can manage an external mysql server as well..
Is that possible?
Thanks
...
Ive been struggling to get my data to insert into my table. The data is pulled from an xml file into an array and echo'ing the results are fine but it fails on insertion.
$dbhost = 'XXXX';
$dbuser = 'XXXX';
$dbpass = 'XXXX';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
if($conn)
{
echo "D...
In MySQL Workbench table editor there are 7 column flags available: PK, NN, UQ, BIN, UN, ZF, AI.
PK obviously stands for Primary Key. What about others?
...
I'm tring to convert a Mysql query to using a LIKE clause and I can't make it work.
$query = "SELECT id,name FROM `hin` WHERE name = '".$q."'";
What I've tried in some variations.
$query = "SELECT id,name FROM `hin` WHERE name LIKE %'".$q."'%";
I need the query to select row only on string match. Intend is to use variable as needle...
i using MySQL Query for my task.
And I interested using Date and time function.
can i use DAY(), WEEK(), and YEAR() at one query?
SELECT Object
FROM table
WHERE DAY(date) BETWEEN 1 AND 7
GROUP BY WEEK(date, 1), YEAR(date)
i want do this bcoz i'm worry if sometimes my program have an error because of the date setting and not rec...
I know it can be simple to access a mysql or sql database on godaddy.. i have done it before, but now i have lost the code. Now the code that should be working just comes up with a security exception.
So how do i create a asp or aspx file on my godaddy free hosting account that will connect to a database i have already set up (mysql,sql...
have a poll table which has 10 categories and I want to view the top 5 results from highest to lowest limit into 5 categories. How can I do this in php and mysql?
here are example tables
categories
id
category_name
Votes
id
category_id
user_id
Users
id
username
here is my sample query:
$q = mysql_query("SELECT * from categ...
I have to tables, keywords and data.
Table keywords have 2 columns (id, keyword), table data have 3 columns (id[foreign key of keywords.id], name, value).
I am using this query:
SELECT k.id, d.value, d.name
FROM keywords AS k
INNER JOIN data as d ON k.id = d.id
it returns something like:
1 123 name1
1 456 name2
2 943 name1
3 542 n...
In MySQL table, I have a field called "Tag", which may include multiple comma-delimited values.
I want to select rows where the Tag field contain the value of "1".
How would I write my MySQL statement so I select rows with Tag values of "1" and "1,Cars",
but exclude the rows with Tag values of "17" and "17,Cars"?
The problem that I'm...
Dear ladies and sirs.
Examine the following scenario. There is a table with two columns - DateWithoutMilliseconds and Milliseconds. Together these two columns define the exact timestamp with the milliseconds.
Is it possible to write a single SQL statement (not using stored procedures) which would fetch the row with the minimum timestam...
I have the following scenario. I must run a query and then save it to memory, and if I need the same result again to obtain it from memory.
Storing and reading from memory is made with memcache. The problem is that if you hold information in an array one at a time just have to treat two cases: 1 for resource type and one for array type....
Hello Stack Overflow!
I'm working with someone else's database connection PHP function that works fine as long as I pass it at least three arguments. If I pass it two argument, then the apache log says:
mysql_real_escape_string() expects parameter 2 to be resource, null given
I need the function to take a SQL query like so:
$sql = D...
Hi all,
I need to optimize a query in MySQL i am retrieving a set a records from the database and populating in a grid view...but it takes around 45 sec for the grid view to be populated...This is my query:
SELECT Distinct
vc.VideoCategoryId,
video.Id as VideoId,
video.VideoTitle as Title,
video.ArticleAbstract as Des...
I have a column that uses time stamp. My question is I am a bit confused about how to make queries against it,how would I say
Where $time is after X date
Are queries made in local time or CUT?
When I just try to do where andthe post date /time I get an error because of the space and if I quote it I think it takes it as a string : /
...
My application needs to poll a MySQL database for new rows. Every time new rows are added, they should be retrieved. I was thinking of creating a trigger to place references to new rows on a separate table. The original table has over 300,000 rows.
The application is built in PHP.
Some good answers, i think the question deserves a boun...
In the following example, I am getting all the values greater than '2009-11-29' as well as NULL and '0000-00-00'. Is there any other way to get the same results?
mysql>select * from totest;
+---------------------+
| stime |
+---------------------+
| 0000-00-00 00:00:00 |
| 2009-12-12 12:22:32 |
| 0000-00-00 00:00:00 |
|...
Hi;
I want the count of a total groups.
I have following query. I want how many groups this query returned based on web_id. Lets suppose if it grouped under 4 groups. I need count 4.
select * from web_details where redirected = false group by web_id
I hope my question is understood.
...
I have table:
name marks
aaa 100
aaa 56
aaa 120
bbb 56
bbb 60
The result should be:
aaa 120
bbb 60
ie unique name with maximum marks. Is there any query in mysql?
...
Hi guys, as the title states, I am trying to query multiple mySQL tables in the same DB simultaneously, here is my query,
SELECT * FROM `database_db`.`one, two, three, four, five, six, seven` WHERE uid='1234567'
I am using mySQL workbench to do the query, but when I run it I get this error
Error Code: 1103
Incorrect table name 'one,...