Re: [PHP-DB] MySQL performance and crash

2004-10-02 Thread Mikhail U. Petrov
MySQL is stable enough. May be it'll be better to rewrite your code or 
to add some indexes to Users?
I can help you with ideas of refactoring.
Murat BIYIKLI wrote:

I use a Linux web server with PHP-MySQL. The hardware is good enough with
2GHz CPU and 1 GB RAM. and 7200 Cycle/min Serial ATA IDE HDD. Only one web
site is running on it and on every page of that site, it searchs for a value
in Users table including 78000 records and updates that value. The MySQL
crashes on everyweek and needs to be killed and restarted, sometimes the
server becomes unreachable and needs to be restarted.
Do you think MySQL is not stable or bad configured? How to optimize that and
monitor what goes wrong, or is it time for Oracle?
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySql Client API still old version

2004-09-14 Thread Mikhail U. Petrov
1. Did you install MySQL-client or only MySQL-server?
2. Do you think I'm a telepath? Please, if you want good answers, tell, 
at least, your OS and PHP version.
  I can't help you without any information.
3. You choose wrong maillist for this question. Here are many 
php-programmers, but not system administrators.

Best wishes, MadMike.
http://www.madmike.ru/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Test

2004-08-02 Thread Mikhail U. Petrov
test
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] generating reports in php

2004-07-28 Thread Mikhail U. Petrov
First, describe more details about reports such you need.
Second, please, do not start new topics by replying on existing. It 
breaks strukture of mailing list and makes view of topics complicated.
Carlos Merino wrote:

hi,
   Is there any product to create reports in an easy way like Crystal 
Reports or Access?
I want to create a report that can be stored in XML and I want to 
insert this reports
to be web available. Advices??

thanks in advance
CArlos
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL software question

2004-07-28 Thread Mikhail U. Petrov
May be ERwin or BPwin can help you.
imho ERwin works with MSSQL, Access, so maybe new versions work with 
MySQL too.
Vincent Jordan wrote:

Is there a piece of software that will allow my to create MySQL
databases and table relations in a graphical format without having to
connect to the database?
I am looking for something where I can point and click the creation of
tables and easily create several relationships between tables ( kinda
like in access ) and when in done it will create the .sql file?
I prefer this to be a desktop application.
Thanks
 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] ummm i am confused

2004-06-26 Thread Mikhail U. Petrov
Hi!
Insert one more bracket!
?php
//Database Querys
$dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
   or die(Could not connect to server, incorrect username,
password or host : .mysql_error()); -this bracket!!!
$connection=Mysql_connect($dbHost , $dbName , $dbPassword)



Saturday, June 26, 2004, 7:23:30 PM, water_foul wrote:

w i get the following error:
w Parse error: parse error, unexpected ';' in
w C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s
w ervices.php on line 4
w from the following code:
w ?php
w //Database Querys
w $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
wor die(Could not connect to server, incorrect username,
w password or host : .mysql_error();
w $connection=Mysql_connect($dbHost , $dbName , $dbPassword)
w //function zone

w //creates table
w function tablecreate($num,$connection){
w $items=mysql_query('SELECT Row_Decription, Required_Items, Misc FROM
w RuneRunner WHERE ID = $num',$connection);
w $item=mysql_fetch_array($items);
w $users1=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price FROM
w RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
w RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
w RuneRunnerPrices.user_id = 1',$connection);
w $user1=mysql_fetch_array($users1);
w $users2=mysql_query('SELECT RuneRunner.rune, RuneRunnerprices.price FROM
w RuneRunner INNER JOIN RuneRunnerprices ON RuneRunner.User_Id =
w RuneRunnerprices.User_Id WHERE RuneRunnerprices.ID = $num AND
w RuneRunnerPrices.user_id = 2',$connection);
w $user2=mysql_fetch_array($users2);
w print ('trtd' . $item[1] . '/tdtdimg
w src=module/runescape/Runerunner/' . $user1[1] . '.gif' . $user1[2].
w 'brimg src=module/runescape/Runerunner/' . $user2[1] . '.gif' .
w $user2[2]. '/tdtd' . $item[2] . '/td/tr');
w };

w //this function is called by another
w function picscreate($Rune,$username,$num){
w print('img src=module/runescape/Runerunner/' . $Rune . '.gif' . $username
w . 'br');
w ${'' . $num . ''}=$Rune;
w };

w //gets data form database and sends it to pics()
w Function picspprep($usernum,$connection){
w $pict=mysql_query('SELECT username,rune FROM RuneRunner WHERE User_ID =
w $usernum',$connection);
w $pic=mysql_fetch_array($pict);
w picscreate($pic[1],$pic[2],$usernum);
w };
?
w iubWelcome to the RuneRunners Runescape service page/b/u/ibr
w iThe currrent Runerunners are:br
w !--begin Database Data--
w ?php
w picspprep(1,$connection);
w picspprep(2,$connection);
?
w !--end Database Data--
w hr
w To order a service, click on the running rune below that matches the one on
w the player you want to buy from above
w /i
w table cellspacing=2 cellpadding=2 border=1
w tr
w tdService/td
w tdPrices/td
w tdRequired Items/td
w /tr
w !--loop database data to create table--
w ?php
w $id=1;
w while($id=296){
w tablecreate($id,$connection);
w $id=$id+1;
w };
?
w !-- end loop --
w /table



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: ummm i am confused

2004-06-26 Thread Mikhail U. Petrov
Hi!



Saturday, June 26, 2004, 7:29:02 PM, Torsten wrote:

TR Water_foul [EMAIL PROTECTED] wrote in message
TR news:[EMAIL PROTECTED]
 i get the following error:
 Parse error: parse error, unexpected ';' in

TR C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s
 ervices.php on line 4
 from the following code:
 ?php
 file://Database Querys
 $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
or die(Could not connect to server, incorrect username,
 password or host : .mysql_error();
 $connection=Mysql_connect($dbHost , $dbName , $dbPassword)

TR You are missing a ; on the above line. PHP even told you on what line the
TR error occurred. You do not have to post all of your code if the error occurs
TR on line 4. And please choose a better subject for your posts.
Try to translate errors better. Error is in missing bracket.


TR Regards, Torsten Roehr



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] access denied

2004-06-26 Thread Mikhail U. Petrov
Hi!
I think you not set this variables. Try to read your full errorlog but
not only one part.


Saturday, June 26, 2004, 7:37:36 PM, water_foul wrote:

w i get this error:
w Warning: Access denied for user: '[EMAIL PROTECTED]' (Using
w password: YES) in
w C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s
w ervices.php on line 3
w and the code up to line 3 is:
w ?php
w //Database Querys
w $connection=Mysql_connect($dbHost , $dbName , $dbPassword);
w 
w i have included this in another script that sets $dbHost, $dbName and,
w $dbPassword to the correct things to connect to the db



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP-DB] Re: ummm i am confused

2004-06-26 Thread Mikhail U. Petrov
Hi!



Saturday, June 26, 2004, 7:55:37 PM, Torsten wrote:

 TR Water_foul [EMAIL PROTECTED] wrote in message
 TR news:[EMAIL PROTECTED]
  i get the following error:
  Parse error: parse error, unexpected ';' in
 
 TR
TR C:\Inetpub\localroot\aichlmayr.net\sites\aaron\module\runescape\runerunner\s
  ervices.php on line 4
  from the following code:
  ?php
  file://Database Querys
  $dbconn = mysql_connect($dbHost , $dbName , $dbPassword)
 or die(Could not connect to server, incorrect username,
  password or host : .mysql_error();
  $connection=Mysql_connect($dbHost , $dbName , $dbPassword)

 TR You are missing a ; on the above line. PHP even told you on what line
TR the
 TR error occurred. You do not have to post all of your code if the error
TR occurs
 TR on line 4. And please choose a better subject for your posts.
 Try to translate errors better. Error is in missing bracket.


TR Yes, but he was still missing the ; on the connection line.

Oh, I missed it :)
Yea, you're right, sorry.


-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySql syntax error using PHPWiki

2004-06-10 Thread Mikhail U. Petrov
Hi!
You missed table definition:
 ... FROM my_table where ...


Wednesday, June 9, 2004, 12:57:02 PM, PHPDiscuss wrote:

PPNaml Greetings,

PPNaml I'm trying to set up a PHPWiki using Apache 2.0.49, PHP 4.3.7, PEAR 4.1.0,
PPNaml and PHPWiki 1.3.10.

PPNaml I get this error when trying to load index.php:

PPNaml C:\Program Files\Apache
PPNaml Group\Apache2\htdocs\lib\WikiDB\backend\PearDB.php:778: Fatal[256]:
PPNaml wikidb_backend_mysql: fatal database error

PPNaml DB Error: syntax error 
PPNaml (SELECT sess_data FROM WHERE sess_id='8e7d43511c4184e42da9ed552e431332'
PPNaml [nativecode=You have an error in your SQL syntax. Check the manual that
PPNaml corresponds to your MySQL server version for the right syntax to use near
PPNaml 'WHERE sess_id='8e7d43511c4184e42da9ed552e431332'' at line 1])

PPNaml It seems that the SQL syntax is incorrect as no table is included in the
PPNaml SQL statement. Is it something to do with adding a 'prefix' = '', line
PPNaml to $DBParams in index.php? Is it something else entirely?

PPNaml Any help is appreciated.

PPNaml James.



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] strange query

2004-06-01 Thread Mikhail U. Petrov
Hi!
You should use
having c2
instead of
where c2.


Tuesday, June 1, 2004, 7:09:29 PM, pete wrote:

pM I'm running this query agains a mysql database, its a list of statuses 
pM with a joined table that shows the number of job in that status with 
pM more than 2. However I get the error

pM Unknown column 'c' in 'where clause'

pM select  job_stats.job_stat_id, job_stat, job_stat_code,
pM count(works.job_stat_id) as c
pM from job_stats
pM inner join works on job_stats.job_stat_id = works.job_stat_id
where c  2
pM group by job_stats.job_stat_id, job_stat, job_stat_code
pM order by job_stats.job_stat_order asc

pM Any idead anyone please

pM tia
pM pedro



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] explode() and a database call...?

2004-05-18 Thread Mikhail U. Petrov
Hi!
You should use $row[bands].
But maybe it's only typing error.
I use such methos and have no errors.

Tuesday, May 18, 2004, 7:02:34 PM, Tristan wrote:

TPrsc I'm trying to split up a field from a database that contains a list of 
TPrsc No's (Eg:1, 4, 12, 32)
TPrsc If I do:
TPrsc $bands_array = explode(,, 1, 4, 12, 32);

TPrsc I get the following array:
TPrsc $bands_array[0] = 1
TPrsc $bands_array[1] = 4
TPrsc $bands_array[2] = 12
TPrsc $bands_array[3] = 32

TPrsc All good!
TPrsc However...
TPrsc Calling froma database...
TPrsc $bands_array = explode(',', $row[bands]);

TPrsc I get no values in the array, (I have checked the overall value of 
TPrsc $row[bands] and it does contain 1, 4, 12, 32)

TPrsc os my question is: why is the database call, changing how explode works?

TPrsc Tris...?


TPrsc *
TPrsc The information contained in this e-mail message is intended only for 
TPrsc the personal and confidential use of the recipient(s) named above.  
TPrsc If the reader of this message is not the intended recipient or an agent
TPrsc responsible for delivering it to the intended recipient, you are hereby 
TPrsc notified that you have received this document in error and that any
TPrsc review, dissemination, distribution, or copying of this message is 
TPrsc strictly prohibited. If you have received this communication in error, 
TPrsc please notify us immediately by e-mail, and delete the original message.
TPrsc ***



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Select news based on dates

2004-05-17 Thread Mikhail U. Petrov
Hi!
You can use order by date and such method:
code
$result = mysql_query(blablabla);
$date = foo;
while($news = mysql_fetch_array($result)){
if ($date==$news[date]){
echo new date;
}
echo $news[text];
$date = $news[date];
}


Monday, May 17, 2004, 3:50:04 PM, T. wrote:

THG Hello,

THG I would like to display my news like this:

THG *10.04.2004.*
THG - news 1
THG - news 2
THG - news 3
THG *14.04.2004.*
THG - news 4
THG *15.04.2004.*
THG - news 5
THG ...

THG I'm thinking of some while loop but I'm not sure that it will work nor I 
THG know how to create that query.

THG TNX



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] passing var array

2004-04-26 Thread Mikhail U. Petrov
Hi!
At first, you chose wrong list for this question.
Second, for new topic you shouldn't reply to old letter.
Third, to view an array use
print_r($_GET);


Monday, April 26, 2004, 12:33:32 PM, Sukanto wrote:

SK Hi, 

SK How to pass var array to other page?

SK I use $_GET but when I echo it, it appear array...

SK Thanx

SK Sk2 



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] db query problem

2004-04-24 Thread Mikhail U. Petrov
Hi!
Try this:
select
   t1.id,
   t1.standartId,
   t2.id
from
   tasks as t1
   left join
   tasks as t2
   using(standartId)
where
   t1.id='jimmy'

Saturday, April 24, 2004, 5:12:56 PM, Jimmy wrote:

JB I'm using MS SQL Server 2000 and I have a table called tasks with the
JB following schema:

JB id= int identity 1 1 not null
JB standardId= varchar(15) not null
JB userId= varchar(15) not null
JB status= varchar(15) not null
JB beginDt= datetime
JB endDate=datetime
JB active=char(1) // flag 1=display 0=do not display

JB I need to return records based on userId and standardId. Assume I have the
JB following
JB five records:

JB userId: jimmy standardId: EC.01.10
JB userId: jimmy standardId: RI.03.20
JB userId: karen standardId: PC.02.40
JB userId: sally standardId: EC.01.10
JB userId: ted   standardId: RI.03.20
JB userId: joe   standardId: EC.01.10

JB These are the results I need to return:

JB All of jimmy's records: where userId='jimmy'
JB I also need to return all records that match all of jimmy's standardId(s),
JB in other words, I need to return in all other records where
JB standardId='EC.01.10 or
JB standardId='RI.03.20 (without duplicating jimmy's results). Which in this
JB scenario would be userId sally, joe, ted

JB I also need to group the records by standardId.

JB Can this be done in a subquery or is two queries required?

JB Having worked mostly with MySQL I dont' have a lot of experience with
JB subqueries.

JB Any suggestions on the best way to approach this probelm?




-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] db query problem

2004-04-24 Thread Mikhail U. Petrov
Hi!
Sorry for my missing..
select
   t1.userId,
   t1.standartId,
   t2.userId
from
   tasks as t1
   left join
   tasks as t2
   using(standartId)
where
   t1.userId='jimmy'
I think it should work.


Saturday, April 24, 2004, 5:12:56 PM, Jimmy wrote:

JB I'm using MS SQL Server 2000 and I have a table called tasks with the
JB following schema:

JB id= int identity 1 1 not null
JB standardId= varchar(15) not null
JB userId= varchar(15) not null
JB status= varchar(15) not null
JB beginDt= datetime
JB endDate=datetime
JB active=char(1) // flag 1=display 0=do not display

JB I need to return records based on userId and standardId. Assume I have the
JB following
JB five records:

JB userId: jimmy standardId: EC.01.10
JB userId: jimmy standardId: RI.03.20
JB userId: karen standardId: PC.02.40
JB userId: sally standardId: EC.01.10
JB userId: ted   standardId: RI.03.20
JB userId: joe   standardId: EC.01.10

JB These are the results I need to return:

JB All of jimmy's records: where userId='jimmy'
JB I also need to return all records that match all of jimmy's standardId(s),
JB in other words, I need to return in all other records where
JB standardId='EC.01.10 or
JB standardId='RI.03.20 (without duplicating jimmy's results). Which in this
JB scenario would be userId sally, joe, ted

JB I also need to group the records by standardId.

JB Can this be done in a subquery or is two queries required?

JB Having worked mostly with MySQL I dont' have a lot of experience with
JB subqueries.

JB Any suggestions on the best way to approach this probelm?




-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Handling missing rows on joins

2004-04-21 Thread Mikhail U. Petrov
Hi!
I think it'd be good to add in hf_users column status - ENUM('Active',
'Blocked', 'Deleted'), and when user
will be deleted you should set this status to Deleted. Value 'Blocked'
may give you a simple way to ban user :)
Yes, this method of deletion take more database space, but it'd be
better, I think...

Wednesday, April 21, 2004, 1:22:30 PM, -{ wrote:

RB Working with PHP 4.3.0 and MySQL 4.0.14 (but code MUST be compatible with
RB 3.23.56).

RB For my forums, I've got this 4-way join to load (and output) the posts with
RB info on the poster:

RB $fullthread = SELECT
RB postID,hf_posts.userID,name,time,post,edit,nickname,joined,location,posts,levelname
RBFROM hf_posts,hf_users,hf_user_stats,hf_levels
RBWHERE hf_posts.threadID='$threadID' AND
RB hf_posts.userID=hf_users.userID AND hf_user_stats.userID=hf_users.userID AND
RB hf_levels.levelID=hf_users.levelID
RBORDER BY hf_posts.time ASC;

RB I'm not gonna paste the entire table structure, cuz it comes to rather many
RB rows those 4 tables make up. But it's pretty basic really: hf_posts contain
RB the posts in the forum. hf_users contains the static userinfo = the user's
RB profile, level assignment and a few control values. hf_user_stats contains
RB the dynamic user info - number of posts  threads, last login and logout,
RB last IP, and things like that. hf_levels contains information and general
RB perms for the user levels.

RB hf_posts has postID as primary key, and threadID and userID as foreign keys.
RB hf_users has userID as primary key, and levelID as foreign key.
RB hf_user_stats is basically an extension of hf_users, and thus only have
RB userID as primary key, but it also functions as foreign key.
RB hf_levels has levelID as primary key, and no foreign keys (it's a top-level
RB table in the relations).

RB The way it's made, when a post is made, the poster's userID and displayname
RB is stored in hf_posts under 'userID' and 'name' respectively.
RB But the poster's current displayname is always in hf_users.nickname. Posts
RB by unregistered users (or those not logged in) are stored with userID 1.

RB Since the system allows unregistered users to post, I've got a guest user
RB implanted into the hf_users table on ID 1, just so the join won't fail to
RB display those posts. When the script outputs the posts, it checks the userID
RB of the posts. If the userID = 1, then it prints the displayname stored with
RB the post, and skips the userdata for that post, otherwise it uses the
RB displayname from the users table.

RB But here comes the problem: If a user is deleted, the records from hf_users
RB and hf_user_stats will be gone. On the join, this means that any posts made
RB by the deleted users will not be included, and thus not displayed -- they
RB become dangling posts in the database ...

RB I haven't actually written the code to delete users yet, but my current idea
RB for a workaround is that on deleting the users, changing all their posts to
RB userID 1 (the system guest level). This would atleast let the posts be
RB displayed, although make those posts display as posted by a guest, and
RB because the displayname is stored with the post, it would not list as
RB Visitor/guest.

RB What I have problem with is figuring out whether this is a kludge or the
RB only way to do it. Or is there a better way to make the join so it will
RB include the posts even if it cannot find anything to join with in hf_users
RB and hf_user_stats ???

RB I know it looks like deleting levels will cause problems as well, but the
RB code for that has been made so deleting a level will move all users assigned
RB to that level to a different one.

RB Any suggestions for handling this better would be appreciated ... 


RB TIA 

RB Rene
RB -- 
RB Rene Brehmer
RB aka Metalbunny

RB ~ If you don't like what I have to say ... don't read it ~

RB http://metalbunny.net/
RB References, tools, and other useful stuff...
RB Check out the new Metalbunny forums @ http://forums.metalbunny.net/



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP-DB] Handling missing rows on joins

2004-04-21 Thread Mikhail U. Petrov
Hi!
But you can replace all information about user on for ex. 'User
real name'='Deleted'



Wednesday, April 21, 2004, 6:34:36 PM, -{ wrote:

RB The problem with this is legal issues. According to Danish law, you're not
RB permitted to save a person's details for more than a certain amount of time
RB after their account has been cancelled/discontinued. The amount of time is 6
RB months to 2 years, depending on what kinda details we're talking about (I
RB haven't checked what would apply to my situation, but it goes for any kind
RB of business, service, or organization that uses user registration and
RB storage of personal details)...




-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Curious if include_once will work better than include

2004-04-13 Thread Mikhail U. Petrov
Hi!
Include_once can't include one file several times.
I think if you use include_once PHP see if that file already were
included, and don't include it one more time...
Maybe difference is time to check this...

I don't trust this fact:
KR Now will that speed things up compared to just using a plain include. I call 
$connectionSDWIS(which is in the include) 5 different times?
-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]



Tuesday, April 13, 2004, 7:52:10 PM, Karen wrote:

KR Curious about include_once versus include.
 
KR All my connection stuff is in conn.php3.
 
KR I am planning on including it at the top of the page like this:
KR include_once conn.php3;
 
KR Now will that speed things up compared to just using a plain include. I call 
$connectionSDWIS(which is in the include) 5 different times?
 
KR $data = odbc_do($connectionSDWIS,EXEC sp_SanitarySurveyLatest '$pwsno');
KR $data = odbc_do($connectionSDWIS, Select Distinct CASE ActivityStatus WHEN 'A' 
THEN 'ACTIVE' WHEN 'I' THEN 'INACTIVE' END + ' ' + CASE Convert(varchar,ActDate,107) 
WHEN 'May 05, 1955' THEN ''
KR ELSE Convert(varchar,ActDate,107) END As 'ActivityStatus' FROM Inventory Where 
PWSID='$pwsno'); 
KR $data2 = odbc_do($connectionSDWIS,Exec sp_EntryPointsWithSourcesAndPWS '$pwsno');
KR $data=odbc_do($connectionSDWIS,SELECT StateID, WSFName, TreatmentProcess, 
TreatmentObjective FROM Treatments WHERE PWS= '$pwsno' ORDER BY StateID);
KR $data = odbc_do($connectionSDWIS, SELECT CalendarYear, 
convert(varchar(12),ReceivedDate, 107), convert(varchar(12),CertifiedDate, 107) FROM 
CCRS WHERE PWS='$pwsno' ORDER BY CalendarYear Desc);


KR -
KR Do you Yahoo!?
KR Yahoo! Small Business $15K Web Design Giveaway - Enter today

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] How to get only 2nd row in result set ???

2004-04-02 Thread Mikhail U. Petrov
Hi!
But what's the problem?
You can use mysql_fetch_array() 2 times.
But may be I understood question not correctly...


Friday, April 2, 2004, 10:06:05 PM, -{ wrote:

RB I couldn't find anything like this from my archive searches ... so here goes:

RB I've got this query:

RB $levels = mysql_query(SELECT levelID from hf_levels ORDER BY levelorder 
RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error());

RB but I can't figure out how to write the rest of the code ... I need to skip 
RB the first row and get the data from the 2nd row... but because there's an 
RB optional up to 255 possible rows in this table, and the order of these are 
RB determined by a user customizable field called levelorder ... so I can't 
RB just pick the specific numrows - 1 ... :-/

RB I know this is a kludge to do it this way ... but it's what I need for now 
RB ... later I'll get to do it a more brilliant way...


RB TIA

RB Rene
RB -- 
RB Rene Brehmer
RB aka Metalbunny

RB ~ If you don't like what I have to say ... don't read it ~

RB http://metalbunny.net/
RB References, tools, and other useful stuff...
RB Check out the new Metalbunny forums @ http://forums.metalbunny.net/



-- 
Best regards,
Mikhail U. Petrov
mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] passing a variable value of PHP into the alert of JavaScript.

2004-03-30 Thread Mikhail U. Petrov
Hi!
I didn't exactly understood what you mean, but I think there're no
problems with it... You should echo these variables into html, for
example:

htmlboby bla bla bla
function my_alert(name, lastname, address){
alert(name);
}
?php
echo
javascript:myalert(. $Firstname . , . $Lastname .  and  . $Address . );
?
bla bla bla


Hello Prabu,

Tuesday, March 30, 2004, 5:21:39 PM, you wrote:

PS Dear my friends...

PS I want to make an alert which can display a value from the database.
PS I am meaning :
PS how can I pass a value of a variable from PHP into JavaScript alert ( 
alert($Firstname, $LastName and $Address);

PS Is it possible?
PS -- 
PS _
PS Web-based SMS services available at http://www.operamail.com.
PS From your mailbox to local or overseas cell phones.

PS Powered by Outblaze




-- 
Best regards,
 Mikhailmailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] checkboxes and loops

2004-03-28 Thread Mikhail U. Petrov
Hi!
I think you should rename checkboxes to box[1], box[2] etc.
So you will get an array $_POST[box]. I think it will be better.
Best wishes,
Mikhail U. Petrov,
PHP-programmer



Hello matthew,

Monday, March 29, 2004, 9:45:28 AM, you wrote:

mp OK lets see if I can figure out how to ask this:

mp I am setting up a system for my company to filter through employee 
mp applications.  Most of the applications do not fit the criteria and I 
mp want to allow my bosses a checkbox to the right of them which they can 
mp check or uncheck to remove an applicant.
mp So I run a loop that generates a bunch of check boxes with the name 
mp box1, box2, box3... by running a loop that runs this and increments 
mp counter every time:
mp {
mp input type = checkbox name = box?echo $counter;? value = delete
mp $counter++;
mp }

mp But when I try to create my query that updates the table I have a 
mp problem generating these variable again by referring to them indirectly:

mp *Bad solution 1 (to much work)***
mp if ($box1 == 'delete')   do whatever
mp if ($box2 == 'delete')  do whatever
mp if ($box3 == 'delete')  do whatever
mp if ($box4 == 'delete')  do whatever
mp if ($box5 == 'delete')  do whatever
mp if ($box6 == 'delete')  do whatever
mp ***

mp *Bad solution 2 (doesn't work)***
mp $counter = 1;
mp while (whatever)
mp {
mp if ($box . $counter == 'delete')   do whatever
mp $counter++;
mp }
mp ***

mp How do I get around this problem?
mp Hopefully someone understands what I am trying to say.

mp Matt

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Need help with MySQL query

2004-03-05 Thread Mikhail U. Petrov
Hi!
I need help with simple mysql query.
I have table:
program{
program_id,
partner_id
}
partner{
partner_id,
parnter_name
}
how I can get number of distinct partner_id's where program_id in (
bla bla bla)?
Best wishes,
Mikhail U. Petrov.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP-DB] Need help with MySQL query

2004-03-05 Thread Mikhail U. Petrov
Hi!
Sorry for disturbing, but, at first, this solution isn't right and,
second, I have solved this problem yet. count (distinct blablabla)
is turned to be right.
But thanks...
Hello Viorel,

Friday, March 5, 2004, 12:42:51 PM, you wrote:


VD - Original Message - 
VD From: Mikhail U. Petrov [EMAIL PROTECTED]
VD To: [EMAIL PROTECTED]
VD Sent: Friday, March 05, 2004 11:38 AM
VD Subject: [PHP-DB] Need help with MySQL query


 Hi!
 I need help with simple mysql query.
 I have table:
 program{
 program_id,
 partner_id
 }
 partner{
 partner_id,
 parnter_name
 }
 how I can get number of distinct partner_id's where program_id in (
 bla bla bla)?

VD select distinct a.partner_id, a.partner_name
VD from partner a, program b
VD where a.partner_id = b.partner_id
VD and b.partner_id in (1, 2, 3)

 Best wishes,
 Mikhail U. Petrov.
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
Best regards,
 Mikhailmailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php