Re: [PHP-DB] ORDER BY relevance DESC query

2011-04-12 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend. The problem is here: ( SELECT `reference`, `organization` FROM `ministry_profiles`... In a subselect, you must select just one column. You are selecting two "reference" and "organization". If you really need both, so you must do two subselects: one for "reference" and another for

Re: [PHP-DB] Prepared Statements # of rows

2011-03-04 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend! You can use the PDOStatement::RowCount, but there is a problem (extracted from the PHP Manual, http://php.net/manual/en/pdostatement.rowcount.php): PDOStatement->rowCount - Returns the number of rows affected by the last SQL statement. If the last SQL statement executed by the ass

Re: [PHP-DB] CSV to MyDB

2011-02-25 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend! You can create a DB table with the same structure of your CSV and store it like a normal table, using the mysqlimport command: http://dev.mysql.com/doc/refman/5.5/en/mysqlimport.html In this way, you can do SELECT's and all DML commands. If you want to store the file as you receiv

Re: [PHP-DB] auto_increment

2010-09-08 Thread Adriano Rodrigo Guerreiro Laranjeira
Hello! I didn't use any DROP statements. Do exactly as following: mysql> CREATE TABLE stats2 LIKE stats; mysql> ALTER TABLE stats2 ADD COLUMN id INT NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(id); mysql> INSERT INTO stats2 SELECT *, 0 FROM stats ORDER BY The first line copies the structure of ta

Re: [PHP-DB] auto_increment

2010-09-07 Thread Adriano Rodrigo Guerreiro Laranjeira
Hey friend! I can't see another way to fix your table without a processing (like a stored procedure, script, etcetera). But I believe there is a workaround, which involves a creation of another table. See this: mysql> CREATE TABLE stats2 LIKE stats; mysql> ALTER TABLE stats2 ADD COLUMN id IN

Re: [PHP-DB] PHP ERP Applications Need Suggestions????

2010-06-28 Thread Adriano Rodrigo Guerreiro Laranjeira
Hello! You should look at same good & stable ERP's PHP based, and start your new project from one of them. By example: * BlueErp * Dolibarr * GNU Enterprise * WebERP Cheers, Adriano Laranjeira. On Mon, 28 Jun 2010 17:17:26 +0530 Mohamed Hashim wrote: *Hello everyone,* *I just want to dev