mysql

Session overload - what is "too much data" stored in a session in PHP?

I'm using the session array to cache chunks of information retrieved from the db: $result = mysql_query('select * from table'); array_push($_SESSION['data'],new Data(mysql_fetch_assoc($result))); My question is, is there a limit/a sizeable amount of information that can/should be passed around in a session? Is it ill advised or signif...

How do you port a SqlServer database to MySQL?

I have a SqlServer db that I would like to port to MySQL. What's the best way to to this. Things that need to be ported are: - Tables (and data) - FileStream --> MySQL equivalent? - Stored Procedures - Functions ...

MySQL - Auto Increment after delete

I have a MySQL table with a primary key field that has AUTO_INCREMENT on. After reading other posts on here I've noticed people with the same problem and with varied answers. Some recommend not using this feature, others state it can't be 'fixed'. I have: course table - with 2 fields - courseID, courseName Example: Number of records i...

Why does Model.find behaviour in a deployed environment differ from that in a development enviroment?

Using Ruby on Rails combined with capistrano and git, I've run into an annoying problem.. I have a controller "people" with the index action that looks something like this: def index @people = Person.find( :conditions => params[:search] ) end There is a boolean "is_admin" column in the Person table. Assuming that some of the peopl...

Should I use prepared statements for MySQL in PHP PERFORMANCE-WISE?

I understand the security benefits of prepared statements in MySQL. No need to cover that topic here. I'm wondering about the performance aspect of them. Now, I know when a query using a prepared statement is executed twice in a single PHP script, it's faster because the query is only parsed once, once for each query. The client makes o...

MySQL delete row from multiple tables

Is this the correct way to do it? DELETE t1, t2, t3, t4 FROM table1 as t1 INNER JOIN table2 as t2 on t1.id = t2.id INNER JOIN table3 as t3 on t1.id=t3.id INNER JOIN table4 as t4 on t1.id=t4.id WHERE t1.username='%s' AND t1.id='%s' Thank you. ...

PHP & mySQL: Do I store the Balance column or generate it dynamically whenever the application needs it?

Hi all, WHAT I ALREADY HAVE: Within my application, I have Credit and Debit columns. I am using the Column type as Decimal 8,2 with Default value being 0.00, for both the columns, in the table. When a user gets credited, with say, $50, the credit column gets the value as 50.00 and Debit gets populated as 0.00. WHAT IAM TRYING TO ACHI...

Duplicate mysql table "structure" using PHP only.

Hello Guys. I have table called "users" and I wanna make an exact copy as "users_2" as regard the structure only not the content. I wanna do this using PHP only as I don't have an access to phpMyadmin or mysql console. Do you have an idea how to do that ? ...

MySQL Password Not Working

Hi, When I enter my password into MySQL Command Line Client, it rejects my password, gives 1 beep and closes the window. Can anyone provide me with a basic troubleshooting list of steps (from simple to progressively more technical) to regain entry into MySQL once and for all. Also, can anyone tell me what can cause my password to suddenl...

mysql equivalent data types

I'm coming from a sql server background, what would the equivalent data types be for in mysql: nvarchar (allows for any type text, so it supports funny characters for all languages etc) nvarchar(max) (allows for very long text documents) ...

Advanced SQL query. Top 12 from each category (MYSQL)

I have a MYSQL5 database and PHP 5. I need a query for a games websites index page that only selects the first 12 from each category of games. Here is what I have so far. $db->query("SELECT * FROM `games` WHERE status = 'game_published' AND `featured` = '1' ORDER BY `category`"); The php code then groups games of the same category ...

Java Application to show a lot of charts and stats, storing the data?

I'm working on a Java application, one of its functions is to show detailed information in graph form with the odd statistic and "top 10" list here and there. The data is being generated live by the application, consider it an internet "honeypot", data is the result of external attacks, the graphs will need to be of varying forms such a...

PHP Convert Unix time to ISO and Subtract an Hour

Hello, I'm restructuring my MySQL database, which has several columns in Unix format. Because I already have several rows in the database in Unix format. How can I convert the Unix fields to iso, and then subtract an hour using PHP? For example, I currently have: <?php $unix_time = 1267840800; $conversion = date("c", $unix_time...

PHP date() format when inserting into datetime in MySQL

Whats the correct format using the date() function in PHP to insert into a MySQL datetime type column? I've been trying this date("Y-M-D G:i:s"); but that just inserts "0000-00-00 00:00:00" everytime. ...

How to populate html textbox with mysql data

I'm trying to make an update form. The update part is already working but it would be better if I'm going to put a view button so that the users will not input the data all over again just to update it. I'm working on this code, it there's a button in the html form that with this code as its form action. It's job is to populate the text...

ASP.NET+ MySQL on a large scale. Recommended?

Hey, I'm thinking of using ASP.NET and MySQL together on a large project. Does anyone have any experience in using these two on a large scale and are there any aspects I should be wary of? If there is a chance that there could be compatibility issues, then I may be prepared to purchase an MSSQL license, but I'd rather go the free route...

Howcome my SQL query is not sorting the column?

http://new.monmouthchineseschool.com/curriculum/cantonese/textbook.php if you take a look at 'C1' 一 十 十一 十二 十三 二 三 四 五 六 七 八 九 that is how all the links look like. this is the mysql db for that class CREATE TABLE IF NOT EXISTS `mon_textbook` ( `id` int(11) NOT NULL auto_increment, `class` varchar(255) NOT NULL, `ch` va...

LOAD DATA INFILE only 1 record inserted

I have a csv file that I'm trying to import via the command line. But only 1 row is being inserted. They are comma separated values. I'm on a Mac using Excel Mac. I save as a csv file. How can I tell if the lines are terminated by \r or \n or both? Here is the code I used: LOAD DATA LOCAL INFILE '/Users/eric/Documents/contacts_test.csv'...

How do PHP/MySQL database queries work exactly?

I have used mysql a lot but I always wondered exactly how does it work - when I get a positive result, where is the data stored exactly? For example, I write like this: $sql = "SELECT * FROM TABLE"; $result = mysql_query($sql); while ($row = mysql_fetch_object($result)) { echo $row->column_name; } When a result is returned, I am as...

Any detached/independent Session Library in PHP using Flat File or MySQL?

Any detached/independent Session Library in PHP using Flat File or MySQL? ...