Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Faster DB Setup


Which database setup would be faster to run insert/select/update queries on - 1 table with hundreds of thousands of records, or hundreds of tables with thousands of records (connected by an id)?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
What Is Faster?
What is faster? calling data from a mysql database or a flat text file?

Faster Access
I want to add the same footer to each page. I can use either the include/require or I cn make a function to output the data. BUT - which is quicker and needs less processing time?
What is recommended?

Make Php Faster?
I've been recently testing a little few things with php (mainly speed).
On thing I've noticed is that php is incredible SLOW to start up.
Compared a perl script and php script aside of each other. In case of my
system it took perl roughly 6ms , but php over 30ms . php only got
activated things like MySQL, ming en pdflib.
Ok, the runnings time are pretty short, but I try to make things as
efficient as possible. Mainly because it is for a production server and
can't predict what customers will do.
Are there ways to get php at least to catch up with perl's speed?

Faster To Use Txt File Or Db For Counter
this more of an opinion question, so i figuired i'd get your opinion

do you think it would cause less stress on the server if i kept a log of hits in just a text file, or if i made a table in mysql for it? i would imagine that the flatfile would be faster, just because its not stressing the DB more with every pageload.. but would it really matter?

Faster Way To Get WIDTHxHEIGHT Of An Image
i'm looking for a faster way to get the width and height of an image. PHP Code:

Does HTML Render Faster Than PHP?
I'm redesigning a web site, and it is currently flat HTML files.

I was thinking ahead, and eventhough not every page has PHP code in it, I was thinking of possibly naming all the files with a .php extension. This is so that if in the future if I add any code, I already have the file set up with the appropriate extension.

Does anyone know if this will slow my page load times? Does HTML get served faster than PHP?

Whats Really Faster, PHP (as Module) Or CGI?
There is alot of debate that I see over what the fastest script is among certain people who really don't know much. So for a script that displays no content, just some MySQL work, some calculations, and some headers, what is faster: a PHP script run as Apache module, or a CGI written in C or C++???

Faster Read Of Filenames
I use the opendir and readdir to search for files... but they read in
all files, so sometimes I get several hundreds.
If there is a way to give a wildcard, it might be a lot faster.
Since I do this search 100+ times at certain times, this is the thing
which slows me down.
Disableing this part speeds my code up by 90%.

if($handle = opendir($sSearchPath))
{
while (false !== ($file = readdir($handle)))
{
$file2 = strtoupper($file);
if( (strpos($file2, $code)!==False) && (strpos($file2,
".PDF")!==False))
{
$files[] = $file;
$paths[] = $sSearchPath;
}
}
closedir($handle);
}

Mysql Sum Vs. Php Array_sum - Which Is Faster?
A mysql select query that sums qty * figure as figure_total
or
A mysql select query that grabs qty and figure and stores both in a php array, then sums them via the array_sum() function I would think the SQL way would be faster but unfortunately don't have the time to write a good accurate test based on a reasonably sized database table.

Which One Is Better, Faster? Mysqli, Pdo, Pear Db?
I'm using the php mysqli extension package for all my mysql database connectivity. I'm just wondering if this will be enough for a high traffic database-driven web site? I found there're other extension pdo and pear db but I don't know much about them. Anyone used it? Is it better and faster? What is the advantages and/or disadvantages about them over the mysqli?

Sockets Faster Than CURL?
Is using fsock faster in terms of execution compared to using cURL ? cURL too should be using fsock but cURL also does a lot of other things in the settings which make it slow doesnt it?

Which Function Is Faster: Eregi [or] Stristr?
Which is a faster alternative for determining if a specific string is contained in another, case-insensitively...

eregi(pattern,string) [OR] stristr(string,string)

It's intended for matching multiple parts of user agent names (in an array) against $_SERVER['HTTP_USER_AGENT']

For example:

$agent = $_SERVER['HTTP_USER_AGENT'];
$block = array('asp search','websearch','etcetera');
$blocked=false;

for($i=0; $i<count($block); $i++)
{
// EITHER THIS:
if( eregi("/$block[$i]/i",$agent) ) {
$blocked=true; break;
}
// ... OR:
if( stristr($block[$i],$agent) ) {
$blocked=true; break;
}
}

Creating A Faster Mssql Query
I have a series of tables that I need to sort through. meaning get one peace of info from one table to get the next peace form the next table and so on. My problem is I only know how to write the code to do it in that order. Code:

Fwrite Vs Mysql (update Data), Which One Is Faster ?
I use this code to make a simple log file, counting how many visitors I have each day:
PHP Code:

Speed Of PHP5, Making PHP Faster In General
The people I was working with have a site that uses lots of php
objects. They are having problems with speed. They had a vague idea
that PHP5 has improved handling of objects over PHP4, so it would
probably be faster also.

In fact it seems slower. We did a few timing loops, in which a a
number of objects were created and and members were accessed, and php
5 seemed to run about half the speed of php 4.

Is this in line with what other people are seeing ?

Is this an artifact of the beta -- that some debugging or logging is
being turned on by default which won't be when the real release comes
out ?

In general, what tricks can I do to make either PHP faster ? I
thought of compiling php with higher optimization flags, for instance.
Are there tweaks I can do to the php.ini file ? I'm interested in
anything, for any version of php.

PHP And MySQL A Faster Option Than Coding HTML Files?
In the article about driving your website using PHP and MySQL it seams that if you have large amounts of information ten it would take ages to actually input data. Does sitepoint use a different type of databse or take a shortcut.

Is PHP and MySQL a faster option than coding HTML files. I mean by this, will the page load slower or faster. How about if you use multiple SSI on a HTML page. Would the PHP and MySQL solution be a faster loading one.

XML DOM Setup With PHP
I am using PHP version 4.4.0.0 and apache2 version 2.0.54.

I am trying to install the xml dom support but am not having any luck.

Following the instructions on php.net I have done the following:

1. Set the extensions directory in php.ini extension_dir =
"C:/php/extensions"
2. Loaded the xmldom module by uncommenting the line in php.ini
extension=php_domxml.dll
3. Copied iconv.dll into C:WindowsSystem32 so that it can be found
on my system's path
4. Restarted my Apache Server

phpinfo() shows that xmldom support is enabled

domxml
DOM/XML enabled
DOM/XML API Version 20020815
libxml Version 20611
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.1.7
libxslt compiled against libxml Version 2.6.11

The code that is throwing the error is as follows:

$dom = new DOMDocument();

I am getting the error message:

PHP Warning: domdocument() expects at least 1 parameter, 0 given in
F:webpopup est.php on line 11

CURL Setup
How to setup CURL in wamp?. Please help me!

Server Setup?
I need to setup a new Linux RedHat 7.0 server I need to run. I'm new to this whole world of *nix and server admin but I do have some experience with Microsoft IIS. I was wondering if there's a program or script that will install the latest Apache, PHP, Perl and MySQL on my Linux server. I really don;t have the time to invest in learning everything and I need to get this server up for someone ASAP.

If this isn't available do you know of any tutorials or websites that will help me get this running as quick as possible.

GD Lib Setup Problems
I have Windows XP with PHP5 installed. In the PHP5.ini it reads (not
commented):
extension=php_gd2.dll

The extension path is right as well.

Now I have an Apache running.

However dumping the gd_info causes problems already (so does creating
an image from a JPEG).
Fatal error: Call to undefined function gd_info()

Otherwise, my PHP5 works fine. And when I start PHP.exe, it will even
say "gd module already loaded".

I also restarted my PC.

Php Setup On Win 2000 IIS
php setup on win 2000 IIS how is it done, i've try but the pages dont show up . any one know of a step by step setup tutrioal on this please. I have phpMyAdmin 2.3.3 and My SQL.

LAMP Setup
I am trying to set up a Linux machine (Fedora 3) as a
LAMP server on a LAN with a Windows XP Prof machine. The boxes are connected
via a cheap switch.

I have added the site address to the Hosts file on both machines, flushed
all chains from iptables on the Linux machine and there appears to be no
firewall on XP.

From the XP machine I can telnet mysite.com 80 and get my html test page -
however when I use Internet Explorer it cannot find my page and responds
"The web page you requested is not available offline". The same thing
happens when I use another box with windows 2000. Pressing the connect
button just sends it off looking for - what I assume - is a DNS site

From the Linux machine I have used Tcpdump to monitor the traffic (at least
this is making me learn about Fedora) on the XP machine. I get plenty of
traffic when I use telnet but nothing when I use Internet explorer - I would
have expected something not that I understand what the messages mean

Setup New Database
in a project i want to offer the user a feature that installs a new mysql-db with given values. the values are stored in a *.txt-file.

WORKS:
- create a new db.
- select the database to create tables
- create a table

DOESN'T WORK:
- instert something into table

content of sql.txt: PHP Code:
 CREATE TABLE mytable 

FastCGI Setup
Can anyone give me an example of the setup of FastCGI with php (with
apache). There are some good instruction how to do it with a Zeus
webserver, but none with apache.

Cgi Setup On Apache Under Rhe
i've been wading through the docs and usenet for a bit now trying to
figure out how to setup cgi to run in cgi on a stock rhe box - which is
of course configured to run mod_php. the reason i need to do this is
to test a theory that a certain library (mapscript) failes under
mod_php but not cgi so i'm unconcerned with security issues at this
point: i'm testing only.

i've tried various permutations of cgi.xxx settings in a local php.ini
and SetEnv REDIRECT_STATUS On in .htaccess files to now avail. i'm on
a gov box and don't have admin privs so i'm looking for a way to force
php into cgi mode, even if it's a hack like exporting some vars in a sh
script and exec'ing php.

is there a way to force php into cgi mode that someone can reccomend.

sorry if that has been answered before - but i've been reading/digging
for a few hours with no luck. ps - i'm a php newbie but quite versed
in cgi/www devel in various languages other than php.

PHP IMAP Setup
I am running FreeBSD box 4.5 , i am trying to install PHP, Courier-IMAP and IMP well i have it working except for the PHP IMAP support i am quite new to all this system admin stuff so i'll tell you how i installed PHP /usr/ports/www/mod_php4

i did make , and make install and then choose options from the scrren ie IMAP etc It give a few errors sorry they flew past too quick , anyway even when i put the follwoing line into php.ini extention=imap.so , i get the error that imap.so cant be found Everything else is ok as i have tested the IMAP Server with Sqwebmail but i was trying to get IMP to work. IMP wokrs fine but i get an "invalid function error" for all IMAP functions so it doesnt really work at all.

PHP Setup On Win2K
I've administrated various types of servers and set-up countless development environments for PHP and MySQL I've never created a full production server before, relying on service/hosting providers to do this for me.

So, I'm looking for any advice on setup, bugs, tutorials, technical resources, thoughts, or experiences. Maybe this could become a sticky for technical/security setups? Who knows...

I'm especially interested in custom builds of the php engine. There are many functions I know I'll never use in the life of this server, such as CURL, Cybercash, .NET, FrontBase, etc. I'm looking for tutorials/tips on compiling for Windows if anybody has any. Can a custom isapi module be compiled for windows?

Sql Setup Scripts
Ive recently been asked to take on a site that uses some light weight
php scripts - im a 100% n00b when it comes to PHP so you know whats
coming.

the client went into the files and amended what she thought was her
admin password... only its not... i think its the database connection
login and password

$link = mysql_connect ("localhost", "USERNAME", "PASSWORD") or die
(__FILE__ . __LINE__);

anyone know how i can reset this back to how it was without a backup
or could the host help with this (i am asking them)?

Timer Setup?
is there a way to make a function that would do sometime in a given period of time without anyone having to activated?

Session Setup Difficulties
I've recently set up PHP on a Solaris box. Pretty simple. I've had no problems with the installation. However, I can't seem to get Sessions to work correctly. A session will establish itself, i.e. a file will create itself in /tmp, and if I turn on --enable-trans-sid, I can see the ID. Auto-start will work too, if I turn it on.

The problem is that 1) I can't seem to access the session id through $PHPSESSID, and 2) nor can I register a variable with a value in the session. The strange thing about the second problem is that the variable will register in the session, but I can't assign it a value.

I'm thinking that perhaps I have something configured improperly. I have --enable-track-vars on, but otherwise, I don't know what else might need to be done.

I'm preferring to do this without client-side cookies. I also don't know what needs to be configured for that to work.

How To Setup Gubed Debugger?
I need a debugger for php.
I use Mandriva 2006. Quanta 3.4

I searched for gubed and tried to install.
But cant setup.

please guide me how to setup and which package to download(there are 3
packs)

How I Setup My Mysql Database(s)...
Quick question on how I setup my mysql database(s)...

If my setup is such that I have multiple clients, and each client gets
10 tables to store their data, is it better for performance if I put all
of these tables into 1 large database (with a unique identifier
prepended to each one) or create a separate database for each client?
i.e., assuming 1000 clients, I either would have:

A) 1 database and 10,000 tables in it, 10,000 total tables

B) 1000 databases with 10 tables in each, 10,000 total tables

Intuition tells me that the multiple databases would be better for
isolating data between clients, but I am not sure if this would slow
things down.

All the info I found on this online was inconclusive and mostly was
people speculating, so I hoped you all could help more.

PHP 4.3.4 And MySQL_i_ Extension. How To Setup?
I'm running PHP 4.3.4 on my home Windows XP Pro machine for programming and
testing. In preparation for using PHP 5, I'd like to move to using the
MySQLi extensions (as opposed to the plain MySQL extensions).

I've upgraded to the MySQL 5.0 alpha and have it running fine.

What I haven't been able to locate is the PHP dll needed for the MySQLi
extension. Can anyone point me in the right direction?

The instructions on the php.net site talk about how to compile the Linux
version of PHP for this new extension, but no reference is made to a dll.

I'd like to be able to try this out without having to upgrade to PHP 5 on
this machine.

As an experiment, I took the php_mysqli.dll file that is included with the
PHP5 source code and placed it in my extensions directory. PHP 4.3.4 reports
the following error message in a dialog box "Unknown(): Unable to load
dynamic library 'c:PHPextensionsphp_mysqli.dll'-The specified module
could not be found"

The location is correctly specified, so I suspect that the problem is not as
suggested by the dialog box error.

How Do You Setup Sablotron For PHP4?
I have recently found the XLST functions in PHP. When I looked into using them I found that i needed to setup Expat and then Sablotron before it works. I've downloaded both but m having massive dificulties getting either to do anything. I a running Windoze 2000 Server (IIS 5) and PHP version 4.0.6.

Setup Username And Password
Normaly only Administrator can setup username and password for new users. However, could you please tell me how a visitor can regist himselve a new username and password so that he can post new messages. So he only can read messages but if he wants to post new message, he has to input his username and his password.

(For example, visitor can read message in this forum but if he want to post message he have to regist for an username and password) then he can post). How I can set up like that. I thought that cookies does not work in this case.

PHP Soap Server Setup
i'm trying to set up a soap server to receive and process SOAP requests. however phppatterns.com is down temporarily. Anyone have any other good resources of setting up a SOAP SERVER? there's tons of resources on how to use soap client implementations, but i couldnt' find a good resource on soap servers and wsdl creation!

Sendmail Account Setup
I want to be able to create a sendmail account by commands sent from a web
page. I am using php. After everything is done, I want to enter his info
into the database (easy) and create this sendmail account. Can anyone give
me pointers to explanations/excamples? I have done a quick search on the
web, but haven't turned up anything. In addition, I do NOT want to create a
regular user account on the server -- only a sendmail account.

Initial Setup Problem
I made a very simple page called index.php, and it goes to the Firefox browser and says Opening with dialog box appears and if I say open with Firefox it opens another window

the TEST phpinfo() works, I installed with WAMP base.

<p>This page was created at
<?php echo date("h:i:s a", time()); ?>
on the computer running PHP.</p>

As a Html file it works, it just does not show the PHP stuff

ok= index.html
not ok = index.php

How To Setup A Database On Godaddy.
My hosting service is godaddy.com. In their help files it only tells me how to setup the MYSQL database but it doesnt help you make any codes to use it or anything else. I really wanted to use an MS access database with godaddy. So my question is, how do I setup any form of database on godaddy and make code where people can go to my website and create an account that will allow them to login to a specialized web page?

Setup MySQL On A Standalone Machine
Has anyone setup MySQL on a standalone machine?

Parse Error In Setup.php On Line 207
This question has t have been answered 100s of times already, I have tried to correct this myself but cannot see a problem, When I try to run my /folder/setup/setup.php, I get an error message saying:

Parse error: parse error in /folder/setup/setup.php on line 207

I have looked at line 207 using metapad, but there seems to be no problems with the code!
the code: datestamp varchar(50) NOT NULL default '', thei is using the MySql CREATE TABLE function.

Absolute Beginner (Setup Questions)
I am trying to figure out how to get started with PHP/MySQL.
Everything I've read so far says to start with PHP first. I was
expecting something like Visual Basic Express or some other type of
free IDE. So I discovered that I needed to download a virtual server,
so I downloaded OmniSecure and followed the set up instructions as far
as I could figure them out.

So here is where I'm stuck.

1) While trying to set up and configure everything it tells me to move/
rename a certain .ini file. I can't find this file.

2) Even if I did get set up correctly I'm not sure what program/IDE to
use to begin entering code?

I am obviously a beginner, but have made several Access databases and
basic applications using Visual Basic Express and SQL Server Express
but all of those programs have had various set up wizards that made
everything idiot proof.

How To Setup IMAP Mail Server?
I have run rpm -Uvh --force imap-devel-4.7-6k.i586.rpm and rpm -Uvh --force imap-4.7-6k.i586.rpm is this means that I have setup IMAP mail server? if so this server type is "Cyrus" or "UWash"?

PHP And PEAR And MySQL Setup On Apache
Very experienced developer, newbie to PHP. My situation:

I have installed on my WIndows XP machine the following:
* PHP 5.2.1
* MySQL 5.0
* Apache 2.2

All of these are installed under C:Program Files under their own
directories.

The PHP installation works fine. I can put PHP files under the Apache
htdocs directory and have them run. My challenge now is getting the
MDB2.php libraries to run - right now I am getting an MDB2.php not
found error, which I believe is due to a include_path error...

So, I have 2 PHP.INI files -- one in C:Program FilesPHP and one in
the htdocs directory of Apache. They both have the exact same
include_path defined in the them. The very strange thing is that when
I run phpinfo(), the include_path comes out to be .;C:PHP5PEAR.

I have no idea where this value is coming from (it is the value for
Master and Local). I have search everywhere -- the PHP.INI files, the
registry, the ENV variables --- everywhere -- and I have no idea where
this value is coming from. Where does phpinfo() pull the include_path
from?

If I can track down and change this value to the "real" PHP path, I
may be able to get to the next hurdle of using MDB2!

Setup IMAP Mail Server
How to setup IMAP mail server?

How To Setup GUBED Debugger In Suse9.3
I use suse9.3, KDE3.4, Quanta, Compiled php5.
I need a debugger for php.
I found Gubed.

I downloaded and tried a lot. but vein.

Sessions In A Load Balanced Setup
Has anyone here implemented sessions in a load balanced environment using
database storage as a custom session handler? I'd be interested to hear
about your experiences. Upsides, downsides, bugs, troubles, security, etc.

Running PHP On Command Line & IIS Setup
I am trying to run PHP off of a IIS server....which hasn't be so pretty. I have included the path environment variable C:PHP, rebooted and started back up. Within C:PHP are two executables php-cgi.exe and php-win.exe. everything I have read online has said that all I need to do is point an environment path to this folder and everything should work. wrong!!!!

I try to run a script in dos and get php is not valid command error.....it's as if it isn't recognizing the command path. I have also set up php under properties to be opened by the CLI....so what am I doing wrong here? I'm running IIS 6 with a dedicated server.

How To Setup A Local Server Environment:
I want to setup a localserver environment in my desktop (OS : Win XP)so that i could use ASP.Net , PHP , Ajax ,Mysql and SQL server in that local host.
I want to know wat are the things i should download? and from where it to
be download?


Copyright © 2005-08 www.BigResource.com, All rights reserved