Sponsored Content
Top Forums Shell Programming and Scripting Something went awfully wrong in PHP+MySQL :( Post 302143302 by matrixmadhan on Wednesday 31st of October 2007 01:50:37 PM
Old 10-31-2007
Quote:
I'm currently making changes as you suggested in 1 and 2... I think 3 is linked to 2.
Yes, a sort of.

Quote:
Could you kindly elaborate this one? I seem to have missed some simple sql rules... Regarding the table design, I can change it even now because I'm just testing this on 2 million values... The actual data set contains 50 million values...

This 'id' column of trace is an auto_increment... So can I write something like:
If you have the control of the table design, then its relatively easy Smilie

So what I have been trying to say is
with column1 and an auto increment column you could actually build a hash of the auto increment column and the other column_value

something like,

autoincrement other_column
1 10
2 30
3 5

with this, indexing the column and comparing would become straight forward and the retrieval of the values also would be only in o(1)

Quote:
And if I'm not asking too much, I'd like to know about your 4th point too... I've never worked with autocommit... Maybe I'm unknowingly doing that... Is my code potraying that picture by any chance? How can I disable that? Really sorry for the trouble...
do you have any explicit commit statements in your code ? If so, we could be sure we are overriding autocommit and explicitly we control the order and frequency in which the records need to be committed.

With the code segment that you had posted, I don't see any explicit commit statement being used, so I guess it should be " autocommit "

Try changing that, it will definitely improve the performance level Smilie am sure of that.
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

mysql php

with a limited knowledege of php and sql, what is a good and secure way to do passwords running an https server? (1 Reply)
Discussion started by: macdonto
1 Replies

2. UNIX for Dummies Questions & Answers

PHP and MySQL

I want to design a database, using mysql as a backend, and PHP as the frontend, I wanna be able to easily build forms in PHP to communicate with MySQL, is there any programs that will allow this, I really dont want to program all the forms by hand.. thankyou (2 Replies)
Discussion started by: kwalick
2 Replies

3. Shell Programming and Scripting

Problem with PHP and MySQL

Okay, I'm new to this PHP and MySQL stuff, so help would be VERY much appreciated. :) On my iMac runnning Panther, it has MySQL and PHP installed. Yet when I view a PHP file from the iMac or another computer at my house, I get the source code. What's wrong? (11 Replies)
Discussion started by: Danny_10
11 Replies

4. Shell Programming and Scripting

PHP/MySQL slow_queries

Hi All, I have a problem with my database having lots of 'stale' slow_queries. I think the problem may be because of the following code: $numresults=mysql_query("select * from links where catagory=".$catagory." order by linknum"); $numrows=mysql_num_rows($numresults); I believe this... (4 Replies)
Discussion started by: pondlife
4 Replies

5. Programming

MySQL - PHP

Hello every one i have question i want to build DATAbase using PHP as interface i use shell to access to linux . i have in linux psql and SQLplus i'll call all html files that has db tabels from shell directory. what should to do before design php pages. can build the database sql design... (3 Replies)
Discussion started by: Scotch
3 Replies

6. Shell Programming and Scripting

Mysql is not connected in php

Hi, The php is not able to connect into my mysql database. But i can able to connect by manually. I think that I have missed some points. Please guild for the same. Thanks, Mani (1 Reply)
Discussion started by: Mani_apr08
1 Replies

7. Emergency UNIX and Linux Support

Migration of website... PHP/Mysql -which path for DB.php

Hi, I have two websites: website1.com and website2.com I didn't write either but have successfully moved all the files from website1.com to website2.com I (thought) I installed all the correct php modules and website2 is mostly up and running. However, my boss found that when we go to a... (15 Replies)
Discussion started by: Astrocloud
15 Replies

8. Programming

PHP and MySQL

Hello, While I was interpretation the PHP manual on database security the recent past, it said that you should by no means connect to the database as the super user but rather as one more user with more limited options. My question is: How do you generate new users and set access... (2 Replies)
Discussion started by: AimyThomas
2 Replies

9. Web Development

Can't Install MySQL with PHP

Hi, I'm on a Raspberry Pi with Raspbian Wheezy. I urgently need to get MySQL running with PHP, but I get an error. For example: $con=mysql_connect("127.0.0.1","root","******","ids"); gives PHP Fatal error: Call to undefined function mysql_connect() So, I found I needed to install some... (2 Replies)
Discussion started by: FreddoT
2 Replies
MySQL::Diff::Table(3pm) 				User Contributed Perl Documentation				   MySQL::Diff::Table(3pm)

NAME
MySQL::Diff::Table - Table Definition Class SYNOPSIS
use MySQL::Diff::Table my $db = MySQL::Diff::Database->new(%options); my $def = $db->def(); my $name = $db->name(); my $field = $db->field(); my $fields = $db->fields(); # %$fields my $primary_key = $db->primary_key(); my $indices = $db->indices(); # %$indices my $options = $db->options(); my $isfield = $db->isa_field($field); my $isprimary = $db->isa_primary($field); my $isindex = $db->isa_index($field); my $isunique = $db->is_unique($field); my $isfulltext = $db->is_fulltext($field); DESCRIPTION
Parses a table definition into component parts. METHODS
Constructor new( %options ) Instantiate the objects, providing the command line options for database access and process requirements. Public Methods Fuller documentation will appear here in time :) o def Returns the table definition as a string. o name Returns the name of the current table. o field Returns the current field definition of the given field. o fields Returns an array reference to a list of fields. o primary_key Returns a hash reference to fields used as primary key fields. o indices Returns a hash reference to fields used as index fields. o options Returns the additional options added to the table definition. o isa_field Returns 1 if given field is used in the current table definition, otherwise returns 0. o isa_primary Returns 1 if given field is defined as a primary key, otherwise returns 0. o isa_index Returns 1 if given field is used as an index field, otherwise returns 0. o is_unique Returns 1 if given field is used as unique index field, otherwise returns 0. o is_fulltext Returns 1 if given field is used as fulltext index field, otherwise returns 0. COPYRIGHT AND LICENSE
Copyright (c) 2000-2011 Adam Spiers. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
mysqldiff, MySQL::Diff, MySQL::Diff::Database, MySQL::Diff::Utils AUTHOR
Adam Spiers <mysqldiff@adamspiers.org> perl v5.14.2 2012-04-06 MySQL::Diff::Table(3pm)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy