I'm trying to use the following stored procedure.
DELIMITER $$
CREATE DEFINER=`root`@`localhost`
PROCEDURE `DeleteField`( IN _TABLENAME Text, IN _FIELDNAME text)
BEGIN
if exists (select * from information_schema.Columns
where table_name = _TABLENAME and column_name = _FIELDNAME)
then
alter table _TABLENAME drop column _...
I have a mysql table that includes the fields:
Name - Year - Description
I'd like to display in order by year, but want to split into to columns by decade. My PHP skills are pretty weak, so I only know how to do it the long way where I make a separate query based on the year range:
<?php
echo "<div><h3>1950</h3>";
$list1950 = mysq...
I'm trying to build a set of results from a query in a PHP page. My where clause is complicated and potentially expensive. In my usual languages I'd do something like:
CREATE TEMPORARY TABLE ShortList (ID INT);
INSERT INTO ShortList
SELECT ID FROM Table1 WHERE {Super long query};
SELECT * FROM Table1 JOIN ShortList ON ShortList.ID ...
Greetings,
I want to know if it is possible to stop tinyMCE from adding closing divs to the text.
For example if I enter this text:
<div id="content">
<div id="section-content">
<h3>Our Work</h3>
It then becomes this:
<div id="content">
<div id="section-content">
<h3>Our Work</h3>
</div>
</div>
I do not want those 2 closing divs ...
what is collation usage for database ? well for html
utf-8 i know a bit, like for
displaying other language type. but
whats for in database ? im useing
latin-1 ( default ), my friends told
me that to use utf insted, when i ask
why, they just dont know and said,
others use it. so im questioning what
does collation reall...
hi,
i have a table with about 1 million rows in a mysql 5 database. lately i learned that twitter does allow browsing only a certain number of tweets like last 600 or 6000. in my case user can browse to middle, end or begining of the records. from my point of view this functionality is not neessary, should i do what twitter did?
...
I got a PHP & MySQL script that use windows-1256 charset, I now want to modify the whole script make it completely built on utf-8 charset. starting from mysql DataBase to PHP files.
what is the right steps to achive that's??!!
Note: I use non-Latin language in script (Arabic language).
...
I would like to set up temporary ban system on my site to ban users for example only for one day or one week. I can choose the duration of the ban and appropriate record is made into the database so I would like to know if the is a way to automatically update that record when the ban period is over... or what else would you suggest?
...
Does Postgresql and Mysql use different SQL:s?
I have a book, Head First SQL. If they are different, how do I know which database SQL it is?
...
Is there a function or class in PHP that I can pass a MySQL recordset and I get a JSON string returned that can be passed back to a JavaScript function in an Ajax request?
something like this:
function recordSetToJson($recordset) {
while($rs1 = mysql_fetch_row($recordset)) {
for($count = 0; $count < count($rs1); $count++) {
// r...
Hi Guys,
I'm trying to modify http://www.mytinytodo.net/ to integrate it into an app I'm developing. Unfortunately my jQuery/AJAX ability is rubbish at best.
I want to do two things:
1) Tasks to be placed into a parent div depending on due date class. For example, tasks that have already gone past their duedate are placed inside 'e...
I'd like to create a query in MySQL that has an optional value. When the value is specified the query is filtered by that value, when the value is not all rows are returned. Here's the idea:
public function doQuery($item = 'ANY_VALUE') {
$query = "SELECT * FROM table WHERE item = ?";
db->fetchAll($query,array($item))
...
}
doQuer...
I have a mysql database and an applet in some free hosting site. The applet needs to access that mysql database. How do I do that ? Is it possible to remote access mysql database from an applet? how ?
...
I have an e-commerce application that uses MySQL, and I'd like it to be faster. When a part # is accessed on the website that has been accessed before, the part loads quickly because all the necessary data is already in the INNODB buffer pool. However, if the part # has never been loaded before, that data isn't in the buffer pool yet, so...
Hey Guys,
I am currently designing a dashboard feed that functions similar to the facebook feed. The feed will contain the following:
Notify user of new users
Show referrals sent to users, referrals received
News from the administrator
Up comming events.
Each of the above is stored in it's own table but on the feeds page, they shoul...
Should I use the native .NET connector for MySQL? Or should I use the ODBC connector for MySQL and use that ODBC connection in C#? I am using C# 2010 Express. Which one is easier to manipulate data in a MySQL database?
...
Hi. I have a user with his unique username in a mysql table, but I have to test and do many queries to find it. I wonder if its a better way to avoid all does queries to the db.
I have multiple rows in the table with columns like user1, user2, user3, user4 up to 30.
for ($x=0; $x < 30; $x ++){
$user = "user";
$user .= $x; /...
Which one is better for (mysql) performance ?
"1500 (300x5) Tables with 365 rows per table" OR "(300x5)1500x365 rows in 1 table" ?
(I will get the data(s) with php.)
365 -> days number of the year
if second: I will use "date" and "x_id" to get the 1 row from (300x5)1500x365 rows.
if first: I will use "date" and "table_name" to get 1...
I'm trying to create a csv export of data from mysql using the following query:
SELECT * INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM getfreepellets WHERE 1
And I get the following error:
#1045 - Access denied for user '[username]'@'localhost' (using ...
What is the most flexible design for a table of physical addresses in some variety of SQL? I assume there is something better than { street address, building address, city, state/province/region, country, zipcode }. Also are there standard names for various components of addresses, especially international standard names? Further, wha...