mysql

6 digit numeric column in MySQL

Say I want to maintain a 6 digit ID column for a table in my database -is it possible to specify this at the DB level in MySQL? ...

Unable to modify a table

I'm having trouble with mysql. I can read and write, but now I want to add some fields to a table. I run this command: ALTER TABLE Pubs ADD COLUMN issue tinyint AFTER volume; but get this error message: ERROR 7 (HY000): Error on rename of './user_acct/Pubs.MYI' to './user_acct/#sql2-cb0-76f2.MYI' (Errcode: 13) I created this ...

weird characters in my generated PDF

I'm getting characters in my PDF, i've stripped out \r\n \r \n \t, trimmed everything, decoded html entities and stripped tags. Nothing helps. The data is coming from a MySQL database. Any help would be appreciated. ...

How to build unlimited level of menu through PHP and mysql

Well, to build my menu my menu I use a db similar structure like this To assign another submenu for existing submenu I simply assign its parent's id as its value of parent field. parent 0 means top menu now there is not problem while creating submenu inside another submenu now this is way I fetch the submenu for the top menu <ul cla...

What is difference between this two C# methods

What is the difference between these two cases. Firstly, if I open the connection and pass it into my method as a parameter, compared to opening the connection directly in the method? cnn.open() func(cnn,param1,param2); vs func(cnn, param1,param2) { cnn.open(); //open connection here } ...

Can I join between two MySQL tables stores on separate machines?

I have a relatively light query that needs information from a local MySQL table along with another MySQL table which is stored on a physically separate machine (on the same network). I'm keen to avoid setting up replication just to facilitate this light query that only needs executed once a day. Is there any way that I can join with a ...

declare and assign value my sql stored procedure(5.0.45)

Hi everybody , DELIMITER $$ DROP PROCEDURE IF EXISTS quotations.sp_addservices $$ CREATE PROCEDURE quotations.sp_addservices (In categoryname varchar(25),in servicename varchar(250),in hours float,in cost float,in basis nvarchar (100)) BEGIN insert into categorydetails (Category_Name) values (categoryname); if(categoryname!=null) then ...

I'm using spring, hibernate and mysql. How can I let my app create the table automatically.

Hi guys, I'm using spring, all my annotated entity class information are put in the ApplicationContext.xml. I'm using a MySql database, now how can I use the SchemaExport function in hibernate to create the tables? My application can't create the table automatically, though i have set <prop key="hbm2ddl.auto">create</prop>. This is my A...

(Doctrine-Ubuntu) Get error: doctrine-cli.php: command not found

Hi, (Doctrine-Ubuntu) I run $ doctrine-cli.php command and get doctrine-cli.php: command not found. P ...

MySQL subquery and bracketing

Here are my tables respondents: field sample value respondentid : 1 age : 2 gender : male survey_questions: id : 1 question : Q1 answer : sample answer answers: respondentid : 1 question : Q1 answer : 1 --id of survey question I want to display all respondents who a...

Activetopics - Get max 5 topics per category

Hey, I want to get the 5 latest active topics within several category's. Each topic has a subcatid and this subcatid relates to a catid. What I want is to get the 5 active topics within each catid. I'm trying to use the query below, but this isn't working at all: set @num := 0, @catid := 0; SELECT ...

Is it possible to integrate user databases between Drupal and an ASP&SQL Server platform?

We have a game project designed on ASP&SQL Server, and we need to integrate it's user database with Drupal. This would be easier from Project to Drupal (since there is user_save and user_delete functions available globally by using drupal bootstrap) but I'm not sure if we can execute PHP functions on an ASP platform. Is there any docum...

adding count( ) column on each row

I'm not sure if this is even a good question or not. I have a complex query with lot's of unions that searches multiple tables for a certain keyword (user input). All tables in which there is searched are related to the table book. There is paging on the resultset using LIMIT, so there's always a maximum of 10 results that get withdraw...

two databases in one controller cakePHP

I'm having trouble creating a page, which requires two different databases.. The controller is automaticly set to 'DB2', which is also specified in the database config file. When i add a var $uses = array ('groups') to the controller, which is from the other DB (DB1), i get the data from only DB2 and all requests to DB1 become a inval...

Ubuntu 8.04 LTS MySQL port remote access

Hi! I have tried everything I know, but still no solution to this problem. MySQL works perfectly on localhost, but it seems port 3306 is blocked from the outside... I have commented out "bind-address" in /etc/mysql/my.cnf, and there is no iptables rules that deny this port. (I have even opened the port in iptables just to be sure) St...

Display PHP Query Array in the table

Hi all I would like to display my Query from Mysql on the table. However, my data is like this: Array([0]=>data1, [1]=>data2, [2]=>data3,[3]=>data4,[4]=>pic1,[5]=>pic2,[6]=>pic3,[7]=>pic4); I want to display my table as |data1 | data2 |data3 |data4 |pic1 | pic2 |pic3 |pic4 I know how to display the data in the single ling like...

How can I figure out a users postal code if I have their latitude / longitude location? Need help writing a query.

I'm using HTML5 geolocation to collect the users lat / long and I need to figure out what their postal code is as well. I have a database of all the lat / long for each postal code in the US & Canada. How can I write a query to find out what their postal code is? Below, is an example of how the data is structured in the 'zips' table. ...

Problem passing dynamic parameters to a mysql query from asp.net page

Hi, I've a requirement that I need to read an excel sheet programmatically using asp.net/C# and write the data obtained into a mysql table.The excel sheet contains something around 50 columns and 2000 records.I am able to read the data from the excel sheet and store it in a dataset.I am using the following code to write the data into my...

Select multiple unique lines in MySQL

Hi, I've got a table with the following columns: ID, sysid, x, y, z, timereceived ID is a unique number for each row. sysid is an ID number for a specific device (about 100 different of these) x, y and z is data received from the device. (totally random numbers) timereceived is a timestamp for when the data was received. I need a ...

finding if an anniversary is coming up in n days in MySql

I have a table with anniversary dates. I want a query that returns me rows of anniversaries coming up in the next 10 days. For instance: birthdate --------- 1965-10-10 1982-05-25 SELECT birthdate FROM Anniversaries WHERE mystical_magical_mumbo_jumbo <= 10 +------------+ | birthdate | +------------+ | 1982-05-25 | +------------+ 1 ro...