I have a MySQL DB in which I store data about each user.
I would like to add a list of friends for each user. Should I create a table of friends for each user in the DB or is there a better way?
i have a mySQL table which the data in one of its columns is in a language other than English.(Persian)
when i input data in the table , it is shown properly but when i want to show the data in a php file it displays like this:????
well,what should i do in order to show the data in its correct form?
I have a .sql file from a MySQL dump containing tables definitions and the data to be inserted in this tables. How can I convert this database represented in the dump file into a MS SQL server database?
How do I instruct Nant to tell MySql to run ddl scripts from a particular location and then run other scripts as instructed?
Google let me to many sites which unfortunately do not work...
I want to add 100 entry to users table numbers field, random characters length is 10, all entry should be unique as well. How can i achieve this using MYSQL query code ?
Or do i need to use PHP ?
Help me with code snippets please. Thanks.
Hello,
I backed up my db with mysqldump from phpMyAdmin. Using MySQL 5.0.22. Made no changes to database file. Import fails. Found many instances of extra spaces using notepad, but now cannot find any other such extraneous spaces. Error is 1064.
Any suggestions on how to import file properly?
Thanks.
i want to create a table :
products
which looks like
(these are columns name)
Id Name Category-id Description
now Category-id column gets the values from another table
category
which looks like
Id Name Description
now category.Id is used in products.Category-id
how to do this in mySQL
MySQL keeps saying my syntax is incorrect.
I want to do this:
DELIMITER $$
DROP PROCEDURE IF EXISTS `myprocedure` $$
CREATE DEFINER=`db`@`%` PROCEDURE `myprocedure`(
var_name varchar(10)
)
BEGIN
/* syntax errors below */
DECLARE countTemp integer;
SET countTemp=(SELECT COUNT(Name) FROM mytable WHERE Name= var_name);
/* more stuff */
END $$
DELIMITER ;
What's the correct syntax?
Hi,
I'm trying to make a Tag cloud for every user in own page, I'm using PHP5 and Mysql, My table named "tags" and I want to make a array but in short way. The table like below,
The array can be like
for user1 array={[car,1],[cat,null],[pen,1],[dvd,1],[cd,null]}
Username totaltag tag1 tag2 tag3 tag4 tag5
admin 5 car cat pen dvd cd
user1 1 1 1
user2 1 2 12 1
user3 3 2 10 1
hey guys
i need to add a special text to all rows in my mysql table ,
how to add some text to the end of all rows' content in a table just for one field
i used this code :
UPDATE `blogs` SET `title`= `title`+ 'mytext';
but didnt work for me
I have this mysql query:
SELECT *
FROM Customer c
JOIN eHRDemographic ehD ON ehD.CxID = c.CustomerID
JOIN CustPrimaryWeight cpW ON cpW.CxID = c.CustomerID
WHERE c.CustomerID =22703
GROUP BY c.CustomerID
ORDER BY cpW.CustPrimaryWeightID DESC
This doesn't really work correctly as the CustPrimaryWeight table has multiple enteries and it's simply joining the first entry and not the more recent one as the ORDER statement doesn't seem to do anything.
Any ideas?
Is there a way in java to create a string with a specified number of a specified character? In my case I would need to create a string with 10 spaces. My current code is:
StringBuffer outputBuffer = new StringBuffer(length);
for (int i = 0; i < length; i++){
outputBuffer.append(" ");
}
return outputBuffer.toString();
Is there a better way to accomplish the same thing. In particular I'd like something that is fast (in terms of execution).
dear all,
i want to fire a trigger after my table has been filled woth reords ,i dont want to fire a rowwise trigger.please tell how can we do that in mysql.
Is Object the base class of all objects in Javascript, just like other language such as Java & C#?
I tried below code in Firefox with Firebug installed.
var t = new Object();
var s1 = new String('str');
var s2 = 'str';
console.log(typeof t);
console.log(typeof s1);
console.log(typeof s2);
The console output is
object
object
string
So, s1 and s2 are of diffeent type?
Hello,
I am trying to insert data into a mysql table from a csv file. I am using the infile sql command, but I am having trouble because the first column of the table is an id that is set as an auto increment field. what do I have to set my first column value to in order to get this to work, or can I do it at all?
Thanks
I try in a test version of DBArtisan to set up a datasource and register
both servere as localhost, database to use, my username and password,
but, when testing the connection, I get message that connection failed.
Hooking up from eg. Delphi and other utilities run nicely. But not
DBArtisan,
Is MySQL 5.0 not supported yet ??
Or is it WAMP that is the culprit naming the service wampmysqld insted of just mysqld ??
I've created a salt using; md5(rand(0,10000000)); (there is probably a better way?)
There doesn't seem to be possible to make a text field unique in MYSQL. So how do I check if the salt has already been used for a previous user?
Or should I generate the salt based on the current date/time? as it is impossible for 2 users to register at exactly the same time correct?
i need to connect mysql server from other new server, the IP address of the new server is in UK. please reply me is there any possibility to connect the new one?
Hi!
I have the following data in a c++ string
John Doe 01.01.1970
I need to extract the date and time from it into int variables. I tried it like this:
int last_space = text_string.find_last_of(' ');
int day = int(text_string.substr(last_space + 1, 2));
But I got invalid cast from type ‘std::basic_string’ to type ‘int’. When I extract the "John Doe" part in another string variable, all works fine. What's wrong?
I am trying to compile it with g++ -Wall -Werror.
Hi,
here is the "msg" table on mysql
sent_to customer msg read
------- -------- ------ -----
45 3 bla 0
34 4 bla 1
34 6 bla 0
45 3 bla 0
56 7 bla 1
45 8 bla 0
for example user whose id number is 45 logs in,
i want him to see this,
you have 2 unread msg to your "number 3" customer
you have 1 unread msg to your "number 8" customer
like a news feed
what query should i use for this ?
thx
I am torn between postgreSQL and MySQL but I am forced to install the choosen one on windows. I especially need asp.net membership and i will be installing NHibernate as well.
I'm running program at apache tomcat server, that should be on permanently, but every morning(the client part isn't accessible at night) i receive error message (in apache tomcat console) that MySQL server is off. So is there any way to prevent this?
Thanks in advance!
I have a mysql query where a subquery is:
BETWEEN '5.00' AND '10.00'
And this returns no results.
However when I use Floats or Ints:
BETWEEN 5 and 10
it works
The BETWEEN query also works for other values AS strings, but just not for 5 and 10.
EG:
BETWEEN '4' AND '5'
works.
How could this be?
I've got a data structure that is Key, Value, OtherValues(key, Value). So the OtherValues are attached to the first Key and aren't always there. I can do this as Dictionary<Key, ValueAndListOfOptionalValues> where ValueAndListOfOptionalValues is a class with a string and a Dictionary<string, string>.
I'm wondering if that's really the best way to do it? Sometimes I think that I'm missing some important classes in the Generics namespace, maybe there are better classes out there that I'm not aware of.