mysql

issuing login information upon receipt of purchase

I am selling stuff from here: http://foundationletters.com/buy-master-mind-products/ One of the things on sale is a subscription to a specific website. As you can see, I have connected e-junkie to my authorize.net account. Let's say that I already have pre-generated accounts. In other words, I have logins and passwords that I am sel...

Database to return multi-dimensional result

This is a follow-up question to my previous one. Situation: Table 1: +--------------------+--------------------+ | v_id | v_name | +--------------------+--------------------+ | 1 | v_name1 | +--------------------+--------------------+ | etc... Table 2: +--------------------+--------...

How can I hide a password/username used in a bash script for accessing MySQL?

I am writing a bash script that I plan to execute via cron. In this script, I want to execute a command against a MySQL database, something like this: $ mysql -u username -ppassword -e 'show databases;' For clarity and those not familiar with mysql, the "-u" switch accepts the username for accessing the database and the "-p" is for p...

Setting NULL datetime with Rose::DB::Object and MySQL

I could be wrong here, but it looks like there's conflicting standards here. MySQL treats a stored datetime of "0000-00-00 00:00:00" as being equivalent to NULL. (update - only, it seems, if the datetime is defined as NOT NULL) But Rose::DB::Object uses DateTime for MySQL DATETIME fields, and trying to set a null DATETIME from "0000-00...

Shell script: send sed output to mysql?

Trying to pipe the output of a sed replacement on a text file into MySQL like so: mysql -D WAR | sed -e "s/2000/$START/g" -e "s/2009/$END/g" < WAR.sql That's not working. Nor is: mysql -D WAR < sed -e "s/2000/$START/g" -e "s/2009/$END/g" < WAR.sql What's the proper solution here? ...

How to get output of shell in MySQL ?

In linux I can use ! to start a shell command: mysql >\! ping localhost Is there a way to get the output of shell in MySQL? ...

Managing Unicode Data in MySQL and VB.NET

I wish to develop a client-server application in VB.NET. I want to store some fields in Unicode. As per MySQL documentation I tried the fields with varchar and charset UTF-8 for storing Unicode data. I could insert data using the MySQL connector command object but when I try to display data in datagridview some junk is appearing. What ...

logging MySQL response from PHP page

When I insert a record, I get the message "1 row affected" and while updating "Rows matched:1 Changed:1" How do I get these messages from PHP code? mysql> insert into mytest values ('103'); Query OK, 1 row affected (0.26 sec) mysql> update mytest set id = 12 where id = 10; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1...

MYSQL: Simplify this Query for better performance

How can i simplify this code. coz this uses subquerying SELECT ub.id_product as c_pid,DATE(ub.datetime_prchs)AS datePurchased,cb.bookname, (SELECT GROUP_CONCAT(c.userid ORDER BY c.userid ASC SEPARATOR ', ') FROM user_books ub INNER JOIN campus_bookinfo cb ON ub.id_product=cb.idx_campus_bookinfo LEFT JOIN customer c ON ub.id_custome...

mantis new user registration without email

Mantis needs the new user to click on a link received in a mail. As per company policy, the sendmail (or any other) application can not be active on server. How do I allow users to register without a valid e-mail? Is there anyway I can run an update query and change the password directly in the database and hand it over to the user? ...

how can i set mysql connection charactor in sqlapi++

I want to use mysql with utf8, but i dont know how to set this. can anyone help me? thanks a lot! ...

Storing multiple values in a single cell in MySQL

I'm storing multiple numbers in a MySQL cell by using a delimiter (eg "1,5,10") and the TEXT datatype. How do I perform lookups like this? SELECT * FROM MyTable WHERE MultiVals CONTAINS "5" And lastly, is this the preferred approach to store such values? I'm using this like a linker table, to link certain rows to multiple other rows ...

inserting values into more than two table using one query

is it possible to insert values into different tables using mysql qyery?? ...

why making a user registration must be regular?

hello, everyone. I'm programming a user registration. However, I found a charactor limiting to 'username' from sample codes, such as just '.', ''', '-' are accepted, no space or other blank, etc. Are those restrictions necessary? I'm using MySQL+PHP. If I adopt the following several ways: change the collation of the column to '...

Doctrine ORM - Self join without any real relation

I'm trying to find related objects to one object by matching the objects tags. I've constructed a mysql query which will return the objects that match the most by counting the matching tags. I'm new to doctrine (1.2) so I'm wondering if someone could help me to get on the right track modifying my schema and creating a DQL query? The bi...

MySQL insert into when number of columns don't match number of values

Hi, I have an insert sql statement, e.g. INSERT INTO table_a (col_a, col_b, col_c, col_d) VALUES (1, 2, 3, 4), (2, 1, 6, 9), (3, 1, 4, 5) I want to insert this into another table, however the table I want to insert it into has a different structure to that of the sql statement (it has fewer fields) e.g. table_b has columns 'col_a', ...

Copying MySQL table data to another table

I want to copy the data from one MySQL table to another table. The source table contains 30 million records. the SQL connection gets lost when I tried to copy the data using the SQL query INSERT table2 SELECT * FROM table1 Is there any external tool avaliable to do this job from the shell Thanks Sree ...

My SQL Subquery - Blob returned, need text value

Hi, I'm trying to write a case statement in mysql which checks if a person has booked a room. If they have, then return the roomtype, otherwise return an informative message. ( CASE WHEN (eab.accommodation_id > 0) THEN (SELECT roomtype FROM event_accomodation WHERE id = eab.accommodation_id) ELSE (IFNULL(eab.accommodation_id, 'No accom...

Dependent MySQL SELECT

My problem is the following: My tables are MESSAGE and MESSAGE_COMMENT, MESSAGE (id,content) MESSAGE_COMMENT (id, message_id, content) I need to select all messages and max 3 comments for each message, like in this example: type | id | content M 15 "this is a message with no comments" M 16 "this is another message wit...

How to create a utf8 db with mysqladmin

I feel like this should be simple but i can't work out how to set the character set when making a db with "mysqladmin create". I thought this would work mysqladmin -u root db_name --character-set=utf8 leveraging this bit of the mysqladmin --help text: -O, --set-variable=name Change the value of a variable. Ple...