Re: [PHP-DB] Related Tables - Capture ID

2003-06-26 Thread Adam Voigt
Do the second query, call the mysql_insert_id function,
and that will give you the id of the row it just inserted.



On Thu, 2003-06-26 at 11:43, Marie Osypian wrote:
 Hello,
 
 I have three table in which I am inserting records into in one script.  I
 need to capture the ID of the second tables record insertion to insert into
 a field into a related table in the third.  What would the easiest way to go
 about this in php?
 
 Thanks,
 
 MAO
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP-DB] Reading from a file

2003-07-01 Thread Adam Voigt
$data = file('c:\file.txt');

for($counter = 0; $counter  count($data); $counter++)
$data[$counter] = explode(\t,$data[$counter]);

Poof. For:

bob ninajim joe

You will get:

$data[0][0] = 'bob';
$data[0][1] = 'nina';
$data[0][2] = 'jim';
$data[0][3] = 'joe';

Nice and easy to recurse through.



On Tue, 2003-07-01 at 12:10, Rick Dahl wrote:
 I need to read from a file that is tab delimited.  Is there anyway to specify that 
 it reads between each tab and that is it.  I know fread() uses bytes to figure out 
 what to read but that isn't very practical in my case.  
 
 Also, how do I get rid of any white space at the end of a variable if there is some 
 once it is read in?
 
 - Rick
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-03 Thread Adam Lundrigan
Exactly how would one go about installing the MySQL extension, as a
workaround to the removal of the builtin MySQL library?

Thanks,

-Adam Lundrigan


Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Sun, 29 Jun 2003, Ben Lake wrote:
  Anyone have an input on the recent announcement that about MySQL
  libraries not being present in PHP 5. What other means might be
  available to connect to MySQL?

 This only affects the bundled library.  It doesn't mean the MySQL
 extension is going away.  Just means you will need to install the library
 yourself.  Exactly like you have to install the client library for
 PostgreSQL, Oracle, Sybase, LDAP, IMAP, SNMP, etc. before you will have
 support for those things.

 -Rasmus



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



Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Adam Lundrigan
that doesn't seem to workit tells me that the libmysql.dll file is not a
PHP module.  Where can I track down the PHP module for MySQL?  Its not in my
/extensions directory

-Adam

Lester Caine [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Exactly how would one go about installing the MySQL extension, as a
  workaround to the removal of the builtin MySQL library?

 Just select it in the php.ini list of extensions? That is
 how I get Firebird(Interbase) instead.

 Leaving sections of the code to user choice is much better
 than building in code that lots of people do not want anyway.

 --
 Lester Caine
 -
 L.S.Caine Electronic Services






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



Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Adam Lundrigan
Thanks.  I'll try that

-Adam

Marco Tabini [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Try in the current snapshot at http://snaps.php.net (also, more info on
 my blog).

 Cheers,


 Marco Tabini
 http://blogs.phparch.com

 On Fri, 2003-07-04 at 13:01, Adam Lundrigan wrote:
  that doesn't seem to workit tells me that the libmysql.dll file is
not a
  PHP module.  Where can I track down the PHP module for MySQL?  Its not
in my
  /extensions directory
 
  -Adam
 
  Lester Caine [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
Exactly how would one go about installing the MySQL extension, as a
workaround to the removal of the builtin MySQL library?
  
   Just select it in the php.ini list of extensions? That is
   how I get Firebird(Interbase) instead.
  
   Leaving sections of the code to user choice is much better
   than building in code that lots of people do not want anyway.
  
   --
   Lester Caine
   -
   L.S.Caine Electronic Services
  
  
  
 --

 Marco Tabini
 President

 Marco Tabini  Associates, Inc.
 28 Bombay Avenue
 Toronto, ON M3H 1B7
 Canada

 Phone: (416) 630-6202
 Fax: (416) 630-5057
 Web: http://www.tabini.ca




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



Re: [PHP-DB] Re: How to get PHP to download web contents

2003-07-07 Thread Adam Voigt
Try CURL:

http://us2.php.net/curl



On Mon, 2003-07-07 at 10:17, Steve B. wrote:
 Yes I had tried all those below before posting.
 It sounds like this is the only way to deal with authentication from what I see.
 In windows it works fine from the browser to include name and pass in url.
 In Linux it comes back and asks for the pw again.
 I'd think the only difference would be in headers.
 Is there any header info todo with authentication which come from the client which 
 are not set by
 doing the url name and pw?
 
 Thanks,
 Steve
 
 --- Ognyan Bankov [EMAIL PROTECTED] wrote:
  Steve B. [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
   Hi Nadim,
   It works but not for sites with password window that pops up.
  I see.
  That is HTTP Basic Authentication
  You should use this line:
  $filename = 'http://someuser:[EMAIL PROTECTED]/';
  instead of:
  $filename = http://somesite.com?user=someuserpwd=somepwd;
  
  and source will look like:
  ?php
  // get contents of a file into a string
  $filename = 'http://someuser:[EMAIL PROTECTED]/';
  $handle = fopen ($filename, r);
  $contents = fread ($handle, filesize ($filename));
  fclose ($handle);
  ?
  
  nadim's solution will look like this:
  $html = implode ('', file ('http://someuser:[EMAIL PROTECTED]/'));
  
  
  
  
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 __
 Do you Yahoo!?
 SBC Yahoo! DSL - Now only $29.95 per month!
 http://sbc.yahoo.com
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



[PHP-DB] MySQL Extention in PHP5.0.0b2-dev

2003-07-07 Thread Adam Lundrigan
Apache 2.0.46 (Win32) PHP/5.0.0b2-dev w/ MySQL 4.1.0

I have a question about the mySQL extension in the aforementioned version of
PHP
Whenever I try to load the extension thru adding it to PHP.INI like so I get
an error

extension_dir = C:\Servers\PHP\extensions
.
.
.
extension = php_gd2.dll
extension = php_mysql.dll



The error says that C:\Servers\PHP\extensions\php_mysql.dll could not be
loaded.  However, it doesn't give the same error for php_gd2.dll, it loads
fine.
When I change the extension_dir to the wrong directory, it gives me errors
for both DLLs.  When the directory is right, I still get the error for the
mysql extension

Any Ideas?

Thanks.
Adam Lundrigan



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



Re: [PHP-DB] Regular Expressions? URGENT

2003-08-02 Thread Adam Royle
Hi Aaron,

I found this on a little useful when I started learning regex. Good 
luck 2 ya!

adam

http://www.devshed.com/Server_Side/Administration/RegExp/

Hi All,

Sorry for OT post but need some info.

Does anyone know a good tutorial that explains regular expressions in
DUMMY terms?
I have a list of characters that I need to check to see if
they are in a
string. I tried creating an array of the characters but some
of them are
like  '  and ` which seem to cause some problems.
Any good turotials for regular expressions?

Thanks a bunch!

Aaron


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


Re: [PHP-DB] Limit

2003-08-04 Thread Adam Alkins
If it is a unix timestamp, why not just select rows where the date is = 7776000
(which is 90 days) or if you want to be specific about the months, use mktime()
to generate the timestamp for the date 3 months ago.

-- 
Adam Alkins
http://www.rasadam.com


Quoting Marie Osypian [EMAIL PROTECTED]:

 I don't want to use the limit on this query anymore.  What I want is to
 display all that are dated within the last 3 months.  What would be the easy
 way to do that?
 
 
 SELECT federal_development_id, UNIX_TIMESTAMP(date) AS date, topic, body
   FROM federal_developments
   WHERE pro_solutions = 'Y'
   ORDER BY date DESC
   LIMIT 5;
 
 
 Thanks,
 
 MAO
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


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



RE: [PHP-DB] determining if a query returns no value

2003-08-08 Thread Adam Alkins
Quoting [EMAIL PROTECTED]:

 Youy could use:
 if(!$result) {
   // Don't display
 } else {
 echo Title;
 }
 
 You fill in the blanks

That only checks to see the query failed. A query returning no rows doesn't fail...

-- 
Adam Alkins
http://www.rasadam.com

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



RE: [PHP-DB] Don't know why query works this way

2003-08-11 Thread Adam Alkins
Quoting Aaron Wolski [EMAIL PROTECTED]:

 Here's some functions I use in my development which save on connect and
 query calls for me.
 
 //General Purpose Utilities.
 //db_connect connects to the database server and selects the proper
 database.
 //Arguments: None
 //Returns: Nothing
 
 
 function db_connect() {
 
   mysql_pconnect(localhost,username,password);
   mysql_select_db(Database);
   
 }
 
 
 //db_query queries the database server and returns the results.
 //Arguments: SQL query string
 //Returns: Query results
 
 function db_query($query) {
 
   return mysql_query($query);
   
 }
 
 
 //db_fetch returns the next set of results from a db_query.
 //Arguments: db_query results variable
 //Returns: Next set of query results as an array or 0 if no further
 results are present
 
 
 function db_fetch($results) {
 
   return mysql_fetch_array($results);
   
 }
 
 
 //db_numrows returns the number of rows selected from a query.
 //Arguments: query result
 //Returns: number of rows in the query result
 
 function db_numrows($result) {
 
   return mysql_num_rows($result);
   
 }
 
 
 //Always connect to the database!
 
 db_connect();
 
 
 Keep these in an include file. The db_connect(); goes at the bottom and
 keep the connection open during the routines.
 
 
 To call db_query you would use it like:
 
 $someQuery = db_query(SELECT * from someTable );
  
 
 to get the results out of the query you would call db_fetch and use it
 like:
 
 
 $someResult = db_fetch($someQuery);
 
 If you needed to return an array you would use it with a while or for
 statement like:
 
 While ($someResult = db_fetch($someQuery)) {
 
 }
 
 If you needed to get the number of rows from the query you'd use like:
 
 numRows = db_numrows($someQuery);
 
 or
 
 if (db_numrows($someQuery)  ...)
 
 
 These are just some thing I use to make my life easier.
 
 Hope it helps
 

Not to be rude... but what does that have to do with his question?

-- 
Adam Alkins
http://www.rasadam.com

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



[PHP-DB] Re: PHP MSSQL

2003-08-14 Thread Adam Presley
Ok. Special thanks to Robert Twitty for the answer. I started using the TEXT
datatype to achieve long texts of data. However, PHP.INI is configured by
default to limit TEXT datatype retrievals to 4K. Change the mssql.textlimit
in the INI file to suit your purposes, and use the TEXT datatype.

Thanks!

Shaun Bentley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi
 I am currently trying to use PHP and MSSQL together but I am having a
 few problems.

 I can enter data into the Db OK, but when pulling the data back to display
 on the page, the string cuts to around 250 chars. The Db field is VarChar
 6000 and I can see the whole data in the field.

 I have tried pulling the data out as object, array  row but always lose
the
 end.

 Any help please!

 Shaun





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



[PHP-DB] Re: PHP MSSQL

2003-08-14 Thread Adam Presley
I know what you're going through here. In MS SQL you can define a VARCHAR up
to about 8000 characters, but your PHP mssql_query command only returns 255
(0 - 254) characters. I then tried using the TEXT datatype. TEXT datatype in
MS SQL allows somewhere around 2 billion characters. However, the PHP
mssql_query command only returns 4096 characters every time. This appear to
be a limitation of the PHP MSSQL commands.


Shaun Bentley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi
 I am currently trying to use PHP and MSSQL together but I am having a
 few problems.

 I can enter data into the Db OK, but when pulling the data back to display
 on the page, the string cuts to around 250 chars. The Db field is VarChar
 6000 and I can see the whole data in the field.

 I have tried pulling the data out as object, array  row but always lose
the
 end.

 Any help please!

 Shaun





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



[PHP-DB] Photo Gallery Comments.. NOT WORKING

2003-09-25 Thread Adam Symonds
Hi I have the following code which is a photo gallery, I have set it up so
users
can add comments to the photos, what I want to happen is in the gallery if a
user
has posted a comment on the photo, I want it to say comments under the photo
in the gallery, I have tried doing this using  IN_ARRAY but I am getting an
error msg,

Warning: in_array(): Wrong datatype for second argument
on line 203

line 203 is this: if(in_array($images[$i],$result))echo brfont
class=blueComments/font;
will have a play around with a few things and left yuo know if I suceed b4
you get back.

Can someone see what I am doing wrong with the in_array..

Thanx In advance
Adam

==

?PHP
//start of comments selection...
   $mysql_access = mysql_connect(localhost, username, password) or
DIE(mysql_error());
   mysql_select_db(database, $mysql_access) or DIE(mysql_error());
$query = SELECT * FROM comphotolink WHERE comphotolink.PhotoPath =
$PathVar;
   $result = mysql_query($query, $mysql_access) or DIE(mysql_error());
if ($result) {
while ($r = mysql_fetch_array($result))
{ // Begin While
extract($r);
$PhotoName = $PhotoName;
//echo $PhotoName br;
} //End While
} else {
echo no commentsbrbr;
}

//end of comments selection

//page vars
$total = count($images);
$limit = 15;
$page = $_GET['page'];
$num_prow=3;

//$offset = ($page - 1) * $limit;

//$jpgs=0;
$handle=opendir($PathVar);
$index=0;
$images;
$last_updated;

while($file=readdir($handle)){

if($file!='.'  $file!='..'){
$myfile=explode(.,$file);

if($myfile[1]=='jpg' || $myfile[1]=='JPG'){
$images[$index]=$file;
//$size[$index]=filesize($file);
//$date[$index]=filemtime($file);
$thumb[$index]=$file;
$index++;
$jpgs++;
}
}
}

if(!$images){
print ::BWarning/b::brThis folder contains no allowed image files.;
exit;
}

$total=count($images);

$numPages = ceil($total / $limit);


$j=0;

// Set first set of pictures
if(!isset($pics)){$pics=$page * $limit;}

//$pics = $page * $limit;


$from = $pics-$limit;
$pp = $pics+$limit;
// =OUTPUT=

$query2 = SELECT * FROM eventlistings WHERE PhotoPath = $PathVar;
   $result2 = mysql_query($query2, $mysql_access) or DIE(mysql_error());
if ($result2) {
while ($r = mysql_fetch_array($result2))
{ // Begin While
extract($r);
echo ;
}} //End While

echo div align=centerstrong$EventName - $EventDate/strong br
Directory contains a total of .count($images). image files /divBR;

echo div align=centertable cellspacing=10 cellpadding=10
bordercolor=#CC33CC border=1 class=txttr bordercolor=#00
bgcolor=White;

for($i = $from; $i  $pics  $i  $total; $i++){

if($j == $num_prow){
echo 
tr bordercolor=#00 bgcolor=Whitetd align=center valign=topa
href=\MainPhoto.php?Image=$thumb[$i]PhotoPath=$PathVar\
!-- $images[$i]BRBR --
img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
if(in_array($images[$i],$result))echo brfont
class=blueComments/font;
echo /td;
//
$j = 1;

}else{
echo td align=center valign=topa
href=\MainPhoto.php?Image=$images[$i]PhotoPath=$PathVar\!--$images[$i]
BRBR --img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
//
if(in_array($images[$i],$result))echo brfont
class=blueComments/font;//

$j++;

}
}
echo /tr/tableBRBRBR;

if ($page == 1) // this is the first page - there is no previous page
echo Previous;
else// not the first page, link to the previous page
echo a href=\Gallery.php?PathVar=$PathVarpage= . ($page - 1) .
\ class=cssbtnPrevious/a;

for ($i = 1; $i = $numPages; $i++) {
echo  | ;
if ($i == $page)
echo $i;
else
echo a href=\Gallery.php?PathVar=$PathVarpage=$i\$i/a;
}

if ($page == $numPages) // this is the last page - there is no next page
echo  | Next;
else// not the last page, link to the next page
echo  | a href=\Gallery.php?PathVar=$PathVarpage= . ($page + 1)
. \ class=cssbtnNext/a;
/*
if($i  $total){echo a
href=\.$PHP_SELF.?PathVar=$PathVarpage=$pp\Next/a;}
if($page != $total){echo  a
href=\.$PHP_SELF.?PathVar=$PathVarpage=$total\Last/a/div;}
*/
echo brbr/body/html;

closedir($handle);
?

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



[PHP-DB] Variables not working within Functions

2003-10-15 Thread Adam Symonds
Hi,
I am starting to us functions with my work but I am having troubles
With the variables in the functions..

If I have the following function called from my page it will work but the
variable won’t
($username)
but if I put this code straight on the page then it works fine..

Any reason for the variable not to work in the function but in straight
coding?
Thanx



Sample Function Below:

==
function LoginSystem()
 {
echo div align=right;
if ( !isset( $_SESSION['login'] ) ) {

echo form action=../Users/Login.php method=post;
echo font size=1Username: /fontinput name=user type=text
size=10nbsp;font size=1Password: /fontinput name=pass type=password
size=10nbsp;input type=submit value=GObr;
echo a href=../Register.phpfont size=1Not A Member
Yet?/font/font/anbsp;;
echo /form;

 } else {
echo font size=1Welcome $username nbsp;nbsp;nbsp;a
href=../Users/Logout.phpfont
size=1Logout/anbsp;nbsp;nbsp;/font/fontbrbr;
}
echo /div;
 }


[PHP-DB] $_POST in MySQL query issue...

2003-10-16 Thread Adam Reiswig
Greetings to all.  I am trying for the life of me to place a $_POST[] 
variable in my MySQL query.  I am running the latest stable versions of 
PHP, MySQL and Apache 2 on my Win2kPro machine.  My register_globals are 
set to off in my php.ini.  My code I am attempting create is basically 
as follows:

$table=elements;
$sql=insert into $table set Name = '$elementName';
This works with register_globals set to on.  But, I want to be able to 
turn that off.  My code then, I am guessing, be something as follows:

$table=elements;
$sql=insert into $table set Name = '$_POST[elementName]';
Unfortunately this and every other combination I can think of, 
combinations of quotes that is, does not work.  I believe the source of 
the problem is the quotes within quotes within quotes. I also tried:

$sql='insert into $table set Name = '.$_POST[elementName];
  or
$sql=insert into $table set Name = .$_POST['elementName'];
and several other variations.

Can anyone give me some pointers to inserting $_POST[] statements inside 
of query statements?  I am sure there must be a way but I have spent a 
lot of time on this and am really stumped here.  Thanks for any help.

-Adam Reiswig

PS if anything here is not clear to you, please let me know and I'll 
clarify as I can.  Thanks again.

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


Re: [PHP-DB] $_POST in MySQL query issue...

2003-10-19 Thread Adam Reiswig
A couple of days ago I placed a post regarding using the $_POST[] 
variable in an insert sql query.  Both

$sql=insert into $table set Name = '.$_POST['elementName'].';
  and
$sql=insert into $table set Name = '{$_POST['elementName']}';
worked perfectly.  Thanks to everyone for your help.  My question now is 
regarding the curly brackets in the 2nd example.  Can anyone describe 
why using the curly brackets works and/or how php processes them.  I 
have read quite a bit about php and never come accross thier use in this 
way.  Thanks again.

-Adam Reiswig

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


[PHP-DB] $_POST in MySQL query issue...

2003-10-19 Thread Adam Reiswig
A couple of days ago I placed a post regarding using the $_POST[]
variable in an insert sql query.  Both
$sql=insert into $table set Name = '.$_POST['elementName'].';
  and
$sql=insert into $table set Name = '{$_POST['elementName']}';
worked perfectly.  Thanks to everyone for your help.  My question now is
regarding the curly brackets in the 2nd example.  Can anyone describe
why using the curly brackets works and/or how php processes them.  I
have read quite a bit about php and never come accross thier use in this
way.  Thanks again.
-Adam Reiswig

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


Re: [PHP-DB] keyword searching

2003-11-12 Thread Adam Williams
This is my SQL query:

SELECT seriesno, governor, descr, boxno, year, eyear, docno
from rg2 WHERE seriesno = '$_POST[seriesno]' and governor matches 
'*$searchterm*' or descr matches '*$searchterm*';

So as you can see, its gonna need some work to make it do fulltext 
searching of the descr field.  I'm not really sure how to make it do a 
keyword search, either since holmes*north*carolina doesn't work 
because it only searches  for those words in that order, if descr field 
in the database contains north carolina holmes it won't return that 
result, but I want it to because the person using the db is looking for 
all the fields that contain holmes, north, and carolina.

CPT John W. Holmes wrote:
From: Adam Williams [EMAIL PROTECTED]

CPT John W. Holmes wrote:

From: Adam Williams [EMAIL PROTECTED]

I am selecting a field in a database called description for keyword
searching.  The field contains names of people, states, years, etc.
When

someone searches for say holmes north carolina the query searches for
exactly that, fields which have holmes north carolina, and not fields
that contaim holmes, north, and carolina.  So I run a str_replace to
replace all spaces with *, which turns it into holmes*north*carolina,
but say that north carolina is before holmes in the field, it won't
return

those fields (it only returns fields in which holmes is infront of north
carolina).  So how can I have it return all fields which contain all
the words holmes, north, and carolina in any order, in that field?
Are you doing a fulltext search or just matching a word in a lookup
column?

I'm doing a fulltext search.


What is your query? Assuming MySQL, I get a result like this:

mysql select * from test where match(t) against ('holmes north carolina');
++
| t  |
++
| my name is john holmes from north carolina |
| i'm from the north |
| in carolina is my home |
| did I mention my last name is holmes?  |
++
4 rows in set (0.01 sec)
Isn't that what you want?

---John Holmes...

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


[PHP-DB] keyword searching

2003-11-12 Thread Adam Williams
Hello,

I am selecting a field in a database called description for keyword 
searching.  The field contains names of people, states, years, etc.  When 
someone searches for say holmes north carolina the query searches for 
exactly that, fields which have holmes north carolina, and not fields 
that contaim holmes, north, and carolina.  So I run a str_replace to 
replace all spaces with *, which turns it into holmes*north*carolina, 
but say that north carolina is before holmes in the field, it won't return 
those fields (it only returns fields in which holmes is infront of north 
carolina).  So how can I have it return all fields which contain all 
the words holmes, north, and carolina in any order, in that field?

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



[PHP-DB] informix error

2003-11-19 Thread Adam Williams
Hi, I was wondering if anyone has seen this informix error before.  It has 
me stumped.  Searching on google didn't reveal anything.  Running my query 
in informix returns the proper results, so I'm not sure what the problem 
is.

Warning: ifx_fetch_row(): 4 is not a valid Informix Result resource in 
/usr/local/apache2/htdocs/alephpub/rg2a.php on line 86

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



[PHP-DB] compiling oracle support

2004-02-12 Thread Adam Williams
How do I compile PHP on Unix to have oracle 9 support.  Looking at 
./configure --help and PHP's website, I see no option for oracle 9 
support.  I see --with-oci8 but that appears to only work for Oracle 8.  
Any help?  Thanks!

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



Re: [PHP-DB] MS SQL 'Changed database context' error

2004-02-19 Thread Adam Voigt
This may not be the case, but I've seen this before when the PHP library
didn't know how to express MS SQL's error, so it simply returns the last
message sent which was the informational context change. If it is infact
an error, you should be able to plug the query directly into Enterprise
Manager to see MS SQL's take on the problem, so to speak. =)

But again, this is all just in my past experience's, yours may differ
greatly.



On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote:
 I'm getting the error Changed database context from MS SQL.  I see
 where this is supposedly just an informational message.  I've tried
 setting
 
 mssql.min_error_severity = 11
 mssql.min_message_severity = 11
 
 but to no avail.  What am I missing?  I don't mind the message so much,
 but php treats this as an error, and doesn't execute my query.
 
 I'm running php 4.3.3 for Windows; the SQL Server and web server are on the
 same machine.  I'm using PEAR:DB for the database access.
 
 Thanks.
 
 Michael Flanagan
 voice: (1) 303-674-2691
   fax: (1) 603-963-0704 (note '603' area code)
 mailto:[EMAIL PROTECTED]
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP-DB] MS SQL 'Changed database context' error

2004-02-19 Thread Adam Voigt
Try putting the error suppressor (@) before the query, eg:

@mssql_query

Or, try setting the error reporting:

error_reporting(0);



On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote:
 Thanks, Adam.
 
 I don't get the error in Enterprise manager.  MS has a KB article out that
 says that this message is informational.  I seem to remember that the
 article also says the message comes out some times, and not other times, but
 that you should just forget it.
 
 The particular SELECT statement I'm getting the message on is the second
 query in my script.  The other query is to the same db; in fact, it uses the
 exact same $db connection object.
 
 Any ideas on getting PHP to ignore this info message?
 
 Thanks again.
 Michael
 
 -Original Message-
 From: Adam Voigt [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 19, 2004 12:13 PM
 To: Michael Flanagan
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] MS SQL 'Changed database context' error
 
 
 This may not be the case, but I've seen this before when the PHP library
 didn't know how to express MS SQL's error, so it simply returns the last
 message sent which was the informational context change. If it is infact
 an error, you should be able to plug the query directly into Enterprise
 Manager to see MS SQL's take on the problem, so to speak. =)
 
 But again, this is all just in my past experience's, yours may differ
 greatly.
 
 
 
 On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote:
  I'm getting the error Changed database context from MS SQL.  I see
  where this is supposedly just an informational message.  I've tried
  setting
 
  mssql.min_error_severity = 11
  mssql.min_message_severity = 11
 
  but to no avail.  What am I missing?  I don't mind the message so much,
  but php treats this as an error, and doesn't execute my query.
 
  I'm running php 4.3.3 for Windows; the SQL Server and web server are on
 the
  same machine.  I'm using PEAR:DB for the database access.
 
  Thanks.
 
  Michael Flanagan
  voice: (1) 303-674-2691
fax: (1) 603-963-0704 (note '603' area code)
  mailto:[EMAIL PROTECTED]
 --
 
 Adam Voigt
 [EMAIL PROTECTED]
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP-DB] MS SQL 'Changed database context' error

2004-02-20 Thread Adam Voigt
Well, even though ignoring the error's (which is actually just an
informational message), you could call the error_reporting function
right above the line throwing the message, and then again below that
line, turning error_reporting back to the default level.



On Thu, 2004-02-19 at 16:38, Michael Flanagan wrote:
 Adam,  Thanks for the suggestions.  I don't want to ignore all error
 handling.  Later, I might get an error that I really don't want php to
 swallow due to either of your suggestions.
 
 Has anyone else run into this and solved it?
 
 Any idea why the following lines in the php.ini file don't work?
 mssql.min_error_severity = 11
 mssql.min_message_severity = 11
 
 Michael
 
 -Original Message-
 From: Adam Voigt [mailto:[EMAIL PROTECTED]
 Sent: Thursday, February 19, 2004 12:44 PM
 To: Michael Flanagan
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] MS SQL 'Changed database context' error
 
 
 Try putting the error suppressor (@) before the query, eg:
 
 @mssql_query
 
 Or, try setting the error reporting:
 
 error_reporting(0);
 
 
 
 On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote:
  Thanks, Adam.
 
  I don't get the error in Enterprise manager.  MS has a KB article out that
  says that this message is informational.  I seem to remember that the
  article also says the message comes out some times, and not other times,
 but
  that you should just forget it.
 
  The particular SELECT statement I'm getting the message on is the second
  query in my script.  The other query is to the same db; in fact, it uses
 the
  exact same $db connection object.
 
  Any ideas on getting PHP to ignore this info message?
 
  Thanks again.
  Michael
 
  -Original Message-
  From: Adam Voigt [mailto:[EMAIL PROTECTED]
  Sent: Thursday, February 19, 2004 12:13 PM
  To: Michael Flanagan
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP-DB] MS SQL 'Changed database context' error
 
 
  This may not be the case, but I've seen this before when the PHP library
  didn't know how to express MS SQL's error, so it simply returns the last
  message sent which was the informational context change. If it is infact
  an error, you should be able to plug the query directly into Enterprise
  Manager to see MS SQL's take on the problem, so to speak. =)
 
  But again, this is all just in my past experience's, yours may differ
  greatly.
 
 
 
  On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote:
   I'm getting the error Changed database context from MS SQL.  I see
   where this is supposedly just an informational message.  I've tried
   setting
  
   mssql.min_error_severity = 11
   mssql.min_message_severity = 11
  
   but to no avail.  What am I missing?  I don't mind the message so much,
   but php treats this as an error, and doesn't execute my query.
  
   I'm running php 4.3.3 for Windows; the SQL Server and web server are on
  the
   same machine.  I'm using PEAR:DB for the database access.
  
   Thanks.
  
   Michael Flanagan
   voice: (1) 303-674-2691
 fax: (1) 603-963-0704 (note '603' area code)
   mailto:[EMAIL PROTECTED]
  --
 
  Adam Voigt
  [EMAIL PROTECTED]
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 --
 
 Adam Voigt
 [EMAIL PROTECTED]
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] Connect to MSDE using PHP

2004-02-23 Thread Adam Voigt
I have connected to MSDE from PHP and it does work, what I would
suggest, is ignore trying to do hostnames, and use IP's, so change the
connect line to the IP of the MSDE machine. I know some will say it's
not necessary, but I'm just telling you what I did, and it worked fine
using the standard mssql functions, not odbc.


On Sun, 2004-02-22 at 10:57, John W. Holmes wrote:
 I've downlownded and installed the Desktop Edition of MSSQL and am 
 trying to connect to it with PHP. Has anyone ever accomplished this?
 
 I've uncommented the line in php.ini to load the MSSQL functions and 
 they show up on a phpinfo() page, so that part is good.
 
 When I installed MSDE I tried it without a named instance first and just 
 set an SA password.
 
 Neither of these worked:
 mssql_connect('localhost','sa','password')
 mssql_connect('coconut','sa','password')
 
 where coconut is the name of my computer.
 
 Then I tried installing MSDE again with a named instance and tried
 
 mssql_connect('namedinstance\localhost','sa','password')
 mssql_connect('namedinstance\coconut','sa','password')
 
 and those wouldn't work either. The only response I get is failed to 
 connect to server ...
 
 I'm off to try ODBC. Anyone have any suggestions?
 
 -- 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals – www.phparch.com
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread Adam Voigt
Check these guys out:

http://spenix.com/WebHostingPlans.aspx

Very cheap, very reliable, great features, and support is second to none
I've ever experienced, and before you ask, no I'm not now nor have I
ever been an employee or shareholder. =) Just a satisfied customer.

On Mon, 2004-02-23 at 09:53, [EMAIL PROTECTED] wrote:
 Howdy --
 Would someone point or provide me with an example of PHP + libMysqld 
 (Embedded MySQL server)?
 
   My problem is my churchs web site doesn't provide a MySQL database as 
 a default package (add $15.95/mo)for a MySQL Db.
 
 TIA,
 David
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP-DB] Re: [PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread Adam Voigt
Alright, well with any txt based system, your probably going to run into
problems with multi-users (multiple browsers) updating the DB.

Reguardless, if you must use txtbased, I recommend SQL-Lite, it supports
SQL statements, and is very small and very fast.

http://www.sqlite.com



On Mon, 2004-02-23 at 11:53, [EMAIL PROTECTED] wrote:
 Adam Voigt wrote:
  Check these guys out:
  
  http://spenix.com/WebHostingPlans.aspx
  
  Very cheap, very reliable, great features, and support is second to none
  I've ever experienced, and before you ask, no I'm not now nor have I
  ever been an employee or shareholder. =) Just a satisfied customer.
  
 Admin --
 There is no shortage of good cheap hosting package.
 The choice of hosting providers is out of my hands.
 
 What I'm looking for is a way to implement a  relational database in 
 docuument_root of the web site (ie. /home/username)?
 
 David
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP-DB] Re: [PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread Adam Bregenzer
On Mon, 2004-02-23 at 23:02, [EMAIL PROTECTED] wrote:
 Adam,
 Thanks for your repsone(s) now back the root of the problem.
 As stated above I need to be able to run the database from with the home 
 direcory/document root?

I hesitate to answer this so as to not create a naming confusion but I
can not resist. :)

However, Adam (not me) already answered your question.  If your hosting
provider does not provide you with a mysql or any other database server
you need to use a flat file database solution.  I second his
recommendation of sqlite if you can use it with your hosting provider. 
Another choice may be db or access of you are on windows through odbc. 
If none of these options work for you then you either need to change
hosting providers (which you should since they don't provide what you
seem to need) or you are of course able to write your own database in
PHP and share it with the world. (This is a joke, please don't ask us
how to write your own database).

Also, *please* do not cross post in the future, pick a list and give it
a shot, if you don't have any luck try another one.  I hesitate to cross
post this response but you did not even provide a valid e-mail address
so I am not sure which list you are checking.

Regards,
Adam

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

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



Re: [PHP-DB] Uploading files

2004-02-27 Thread Adam Voigt
Your max post size needs to be upped to, try making it 6M and see if
that makes a difference.


On Fri, 2004-02-27 at 10:05, nikos wrote:
 Hello list
 
 Allthough I set my PHP.in upload_max_file=4M my system refused to upload
 files bigger than 1M and the browser send an server not found error.
 
 Does anybody know anything about that?
 Thank you
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] Uploading files

2004-02-27 Thread Adam Voigt
If your on a slow connection, it might be timing out.

Try putting:

set_time_limit(0);

At the top of the page where the file is being uploaded to (not from),
and see if that helps.


On Fri, 2004-02-27 at 10:29, nikos wrote:
 It is allready 8M
 
 - Original Message - 
 From: Adam Voigt [EMAIL PROTECTED]
 To: nikos [EMAIL PROTECTED]
 Cc: PHP-mailist [EMAIL PROTECTED]
 Sent: Friday, February 27, 2004 5:13 PM
 Subject: Re: [PHP-DB] Uploading files
 
 
  Your max post size needs to be upped to, try making it 6M and see if
  that makes a difference.
 
 
  On Fri, 2004-02-27 at 10:05, nikos wrote:
   Hello list
  
   Allthough I set my PHP.in upload_max_file=4M my system refused to upload
   files bigger than 1M and the browser send an server not found error.
  
   Does anybody know anything about that?
   Thank you
  -- 
 
  Adam Voigt
  [EMAIL PROTECTED]
 
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] Protecting mysql database

2004-03-03 Thread Adam Voigt
Why not just stop the database?


On Wed, 2004-03-03 at 09:41, Piet from South Africa wrote:
 Hi
 
 Is there a way that an alert or something can be generated when a mysql
 database is being accessed in any way.
 
 I want to close the whole database for a period, and nobody may access the
 database via phpadmin or anything else
 
 Appreciate your input on this one.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP-DB] working with ' in SQL

2004-03-04 Thread Adam Williams
Hi, I have an SQL statement that is ran when data is submitted through a 
form.  When someone types in a word with an ' such as farmer's the SQL 
statement fails.  I tried $_POST[data] = addslashes($_POST[data]); before 
executing the SQL statement, but the statement still fails.  any 
suggestions?  using words without a ' works fine.

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



Re: [PHP-DB] PHP - MSSQL connects, but can't query

2004-03-12 Thread Adam Voigt
Hmm, replace the line where you select the DB with:

$dbconnect = mssql_select_db(Northwind) or
die(mssql_get_last_message());

(All on one line incase the email wraps it.)


On Fri, 2004-03-12 at 08:35, Jason Morrill wrote:
 I've got a very simple PHP script for testing my MS SQL Server
 connection. I've installed FreeTDS and I can connect and query the
 database with TSQL.
 
 With PHP I can connect and disconnect properly but I can't query or
 attach to different databases. Here is my sample PHP followed by what
 the web server throws back at me:
 
 sql-test.php
 
 
 html
 body bgcolor=white
 ?php
 $dbproc = mssql_connect(roger,sa,admin);
 #$dbproc = sybase_connect(roger,sa,admin);
 if (! $dbproc) {
 print Can't connect to server;
 return;
 }
 print Connected to server.;
 
 $dbconnect = mssql_select_db(Northwind);
 if (! $dbconnect) {
 print Can't connect to Northwind;
 return;
 }
 print Connected to database;
 
 #$res = sybase_query(select * from test,$dbproc);
 #if (! $res) {
 #   return;
 #}
 #while ($arr = sybase_fetch_array($res)) {
 #   print $arr[i] .   . $arr[v] . br\n;
 #}
 
 if (! mssql_close($dbproc)) {
 print Can't close server connection;
 return;
 }
 print Connection closed.;
 ?
 /body
 /html
 
 
 
 Output in browser when referencing the sql-test.php file:
 -
 
 Connected to server.
 Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'.
 (severity 15, procedure N/A) in /home/www/sql-test.php on line 12
 Can't connect to Northwind
 
 
 
 Can anyone help me figure this one out?!
 
 Thanks!
  Jason Morrill
  IT Manager
  Child  Family Agency SE Connecticut 
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP-DB] PHP - MSSQL connects, but can't query

2004-03-15 Thread Adam Voigt
Yes, I'm connecting to a MSSQL server from FreeTDS, and it works fine.
Try using the IP of the MSSQL server instead of the name, and see if
that makes any difference.


On Mon, 2004-03-15 at 09:23, Jason Morrill wrote:
 I changed the mssql_select_db line as suggested by another person here
 but it didn't change a thing. I still get the exact same error message.
 
 Is there anyone else here connecting to a MS SQL server using TDS v8.0
 ??
 
 Thanks!
  Jason
 
 
 -Original Message-
 From: Jason Morrill [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 12, 2004 8:36 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP - MSSQL connects, but can't query
 
 
 I've got a very simple PHP script for testing my MS SQL Server
 connection. I've installed FreeTDS and I can connect and query the
 database with TSQL.
 
 With PHP I can connect and disconnect properly but I can't query or
 attach to different databases. Here is my sample PHP followed by what
 the web server throws back at me:
 
 sql-test.php
 
 
 html
 body bgcolor=white
 ?php
 $dbproc = mssql_connect(roger,sa,admin);
 #$dbproc = sybase_connect(roger,sa,admin);
 if (! $dbproc) {
 print Can't connect to server;
 return;
 }
 print Connected to server.;
 
 $dbconnect = mssql_select_db(Northwind);
 if (! $dbconnect) {
 print Can't connect to Northwind;
 return;
 }
 print Connected to database;
 
 #$res = sybase_query(select * from test,$dbproc);
 #if (! $res) {
 #   return;
 #}
 #while ($arr = sybase_fetch_array($res)) {
 #   print $arr[i] .   . $arr[v] . br\n;
 #}
 
 if (! mssql_close($dbproc)) {
 print Can't close server connection;
 return;
 }
 print Connection closed.;
 ?
 /body
 /html
 
 
 
 Output in browser when referencing the sql-test.php file:
 -
 
 Connected to server.
 Warning: Sybase: Server message: Line 1: Incorrect syntax near 'e'.
 (severity 15, procedure N/A) in /home/www/sql-test.php on line 12 Can't
 connect to Northwind
 
 
 
 Can anyone help me figure this one out?!
 
 Thanks!
  Jason Morrill
  IT Manager
  Child  Family Agency SE Connecticut 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP-DB] mssql query

2004-03-16 Thread Adam Williams
I've used mysql a little, but now I'm working with a MS SQL SERVER 2000 
database.  We have a proprietary application/hardware setup where 
when a person enters the building, the time they enter the building 
is automatically put into the database in a field called eventtime, and 
their access card is entered in a field called cardnum.  The 
time entered is like the mysql NOW() function (i dunno what its called in 
mssql), the format is -MM-DD HH:MM:SS.000 anyway.  I need to write an 
SQL query that will get a unique count of cardnum based on how many times 
the person enters a building each day.  So I need to do some sort of 
UNIQUE (although in mssql I think its distinct) count on the -MM-DD 
and ignore the HH:MM:SS.000, but looking at the mssql reference book I 
have, it doesn't go into great detail on date functions, so I was 
wondering if anyone knows how to do a unique on the eventtime with 
the date and ignore the time.

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



Re: [PHP-DB] mssql query

2004-03-16 Thread Adam Voigt
SELECT count(id) FROM users WHERE DATEDIFF(eventtime,GETDATE(),d) == 1;

Or something along those lines, all the date functions are very well
documented in the digital books that come with Enterprise Manager.
Open up the reference, and search for datediff, and there should be a
link in there for the date functions as a whole.


On Tue, 2004-03-16 at 10:32, Adam Williams wrote:
 I've used mysql a little, but now I'm working with a MS SQL SERVER 2000 
 database.  We have a proprietary application/hardware setup where 
 when a person enters the building, the time they enter the building 
 is automatically put into the database in a field called eventtime, and 
 their access card is entered in a field called cardnum.  The 
 time entered is like the mysql NOW() function (i dunno what its called in 
 mssql), the format is -MM-DD HH:MM:SS.000 anyway.  I need to write an 
 SQL query that will get a unique count of cardnum based on how many times 
 the person enters a building each day.  So I need to do some sort of 
 UNIQUE (although in mssql I think its distinct) count on the -MM-DD 
 and ignore the HH:MM:SS.000, but looking at the mssql reference book I 
 have, it doesn't go into great detail on date functions, so I was 
 wondering if anyone knows how to do a unique on the eventtime with 
 the date and ignore the time.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] PHP - MSSQL - LINUX

2004-03-17 Thread Adam Voigt
No, if you are attempting to run PHP under Windows, you want the MSSQL
DLL File, if you are attempting to run PHP under Linux or Unix, you want
to install FreeTDS from www.freetds.org


On Wed, 2004-03-17 at 05:17, Santhosh Kumar wrote:
 Hi Madhu,
  I am speaking about MSSQL not MySQL . 
 Is it possible can i get for MSSQL.so from MYSQL Installation.
 
 Thanks and Regards,
 Santhosh Kumar.M
 
 
 - Original Message - 
   From: Madhu Manjari 
   To: [EMAIL PROTECTED] 
   Sent: Wednesday, March 17, 2004 2:27 PM
   Subject: Re: [PHP-DB] PHP - MSSQL - LINUX
 
 
   Hi Santosh Try to install mysql-3..22 source where you will get all libraries 
 by default . After installation of mysql configure php support with mysql. Madhu.  
 Hi All,   Where do I get mssql.so to connect mssql with my PHP4.0.6 and PHP4.3.3  
  Regards,  Santos Kumar.M 
   --
   This Message and any attachments is intended solely for the addresses and is 
 confidential.
   If you receive this message in error or if you are not the intended recipient, 
 please delete the mail.
   Any use not in accord with its purpose, any dissemination or disclosure, either 
 whole or partial, is prohibited.
   Please inform us in case of erroneous delivery, thanks for your cooperation.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] MySql query

2004-03-17 Thread Adam Voigt
Yes, where evaluates to true.


On Wed, 2004-03-17 at 12:03, Matt Matijevich wrote:
 This is probably a question for for a mysql list but I figured someone
 out here knows the answer.
 
 I am working with an existing mysql application and there is a bunch of
 queries that are formatted something like this:
 
 SELECT * FROM sometable WHERE 1
 
 does WHERE 1 just return every row?
 
 thanks in advance.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] MySQL - separating web and database servers

2004-03-18 Thread Adam Voigt
I don't understand, your ready to hack the MySQL extension, rather then
just use one of the free text editors, that let you mass replace all
your pages at once (which takes roughly 10 seconds)?


On Thu, 2004-03-18 at 10:15, Operator wrote:
 Probably I need to change this behaviour in 
 ext/mysql/libmysql/libmysql.c for my installation, but this is 
 my last hope (mostly because I'm not a C programist...) If some 
 of you could tell me if it's possible without breaking 
 something else, or point me to the lines that do the job... I 
 suppose the change needed would be quite simple.
 
 PB
-- 

Adam Voigt
[EMAIL PROTECTED]

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



Re: [PHP-DB] Automatically Refreshing png-Image'd Web Page

2004-03-19 Thread Adam Voigt
You might want to use iframe's so you can refresh just individual
sections when you need to.


On Fri, 2004-03-19 at 12:00, [EMAIL PROTECTED] wrote:
 Howdy Listers,
 
 The Background:
 I am making dynamic, color-coded, png images of the floor plan of a 
 building and displaying them in a browser.  Numerous radioactivity sensors 
 throughout the building send their readings to a MySQL dB, and the web 
 page queries the dB, and depending on the readings, the areas specific to 
 the sensors will appear green for normal, yellow for high but acceptable, 
 and red for critical.  All this works OK.
 
 The Problem:
 Neither the HTML nor JavaScript code I usually use for automatically 
 refreshing a page has any effect if the header(Content-type: image/png) 
 necessary for displaying the png image is included. If I comment out the 
 header() line, the page refreshes, but the image data comes through as 
 hieroglyphics.  Obviously, I need to refresh the page to get the latest 
 data, and to create and display the corresponding image.
 
 The Question:
 Is there any way to automatically refresh a web page displaying a png 
 image?
 
 Thanks in advance for any thoughts/insights into how I can solve this 
 problem.
 
 dave
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP-DB] ocilogon error

2004-03-31 Thread Adam Williams
Hi, I have oracle and PHP working together on a remote server called zed 
that runs redhat linux. I have another computer called accessserver 
that runs win2k pro with PHP that I am trying to connect to oracle on 
zed.  Both computers have the oracle client libraries installed.  On 
accessserver I have the code:

?php
$conn = ocilogon(user,pw,zed.aleph0) or die .ora_error();
if ($conn)
{ echo connection to oracle successful; }
?

When I run this I get the error:

Warning: ocilogon(): OCISessionBegin: ORA-12705: invalid or unknown NLS 
parameter value specified in C:\htdocs\oracleconnect.php on line 2

I've tried looking on google for the NLS parameter but I'm not having much 
luck.  Anyone able to help?  Thanks!

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



[PHP-DB] postgresql

2004-04-14 Thread Adam Williams
Hi, I know this isn't PHP related but I have a quick question about 
postgresql.  I come from a mysql enviroment so I'm a little clueless, even 
after reading the postgresql docs.  

I am moving a postgresql database from one server to another.  As the user 
that owns the database, lculber, I ran pg_dump sroom1  sroom1.database 
but on the server I'm moving the database to, I can't figure out how to 
get into psql to create the user lculber so I can do psql sroom1  
sroom1.database

so how can I create the users lculber in postgresql.  I can't even connect 
to psql.  any advice? :)  below is my command.  I'm not trying to database 
root, I just want to get the psql prompt so I can create the user lculber.

[EMAIL PROTECTED] root]# psql -U root
psql: FATAL:  Database root does not exist in the system catalog.
[EMAIL PROTECTED] root]# createuser lculber
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
psql: FATAL:  user root does not exist
createuser: creation of user lculber failed

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



[PHP-DB] logic problem

2004-04-21 Thread Adam Williams
I'm using some proprietary software/hardware where when a visitor swipes 
their entry card, it is recorded in a mssql 2000 server.  My boss wants a 
count of unique vistors for a range of dates.  So, I need to have it give 
a count of unique vistors, meaning that I need to count all vists for a 
day as one visit (because if they go outside to smoke and come back and 
swipe their card again to get in, each one is a separate visit, but i need 
to count all visits by each person as one visit since i just want to know 
if they came at all each day, not how many times they came in).

This is my SQL statement:

select distinct count(convert( varchar,eventime, 110)) as count, 
convert( varchar,eventime,110) as date from events, badge wher 
events.cardnum = badge.id and devid = '1' and 
convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate'
and type = '1' group by convert( varchar,events.eventime, 110)

for reference, devid = '1' is the hardware device, where everytime it 
triggers, it means someone swiped their card to get in, and type = '1' 
means patron (because we have a type = 2 that is for staff and we jsut 
want to know how many patrons visited)

When I execute this statement, its returning the result for each date of 
the total number of card swipes (so if a person comes in twice on a date, 
its recording it as 2 swipes, but I just need to know that they came to 
the building at all on this date, so I just need it to register that there 
was a count of atleast one for this card that was swiped)

any suggestions?  thanks

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



Re: [PHP-DB] logic problem

2004-04-21 Thread Adam Williams
Yes eventtime is a timestamp field (whatever mssql's version of mysql's 
NOW() is) and the convert( varchar,eventime,110) converts the timestamp to 
a date MM-DD-.

my problem is that with the count, it counts each card swipe, and i only 
need to count one card swipe from each patron per day.  so if they swipe 
their card multiple times, in my php script when i return the results, it 
only returns one visit for each patron each day even if they have visited 
two or more times.

On Wed, 21 Apr 2004, Brent Baisley wrote:

 I think your problem is that you are using time, when you are not 
 interested in time, just the date. I'm assuming your eventime column is 
 a timestamp field. Your goal is to select the badge id and the date, 
 distinct will then eliminate multiple visits and then you can group by 
 date to get the visitor count. The way I see it, the hardest part is 
 converting the eventime to a date or some unique string to represent 
 the date.
 
 
 On Apr 21, 2004, at 1:13 PM, Adam Williams wrote:
 
  I'm using some proprietary software/hardware where when a visitor 
  swipes
  their entry card, it is recorded in a mssql 2000 server.  My boss 
  wants a
  count of unique vistors for a range of dates.  So, I need to have it 
  give
  a count of unique vistors, meaning that I need to count all vists for a
  day as one visit (because if they go outside to smoke and come back and
  swipe their card again to get in, each one is a separate visit, but i 
  need
  to count all visits by each person as one visit since i just want to 
  know
  if they came at all each day, not how many times they came in).
 
  This is my SQL statement:
 
  select distinct count(convert( varchar,eventime, 110)) as count,
  convert( varchar,eventime,110) as date from events, badge wher
  events.cardnum = badge.id and devid = '1' and
  convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 
  'enddate'
  and type = '1' group by convert( varchar,events.eventime, 110)
 
  for reference, devid = '1' is the hardware device, where everytime it
  triggers, it means someone swiped their card to get in, and type = '1'
  means patron (because we have a type = 2 that is for staff and we jsut
  want to know how many patrons visited)
 
  When I execute this statement, its returning the result for each date 
  of
  the total number of card swipes (so if a person comes in twice on a 
  date,
  its recording it as 2 swipes, but I just need to know that they came to
  the building at all on this date, so I just need it to register that 
  there
  was a count of atleast one for this card that was swiped)
 
  any suggestions?  thanks
 
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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



Re: [PHP-DB] logic problem

2004-04-21 Thread Adam Williams
Yeah I basically had that with my previous SQL statement, I was grouping 
by event.cardnum instead of counting the cardnums by date.  I think what 
I'm trying to do is beyond the scope of SQL and I'll have to write some 
PHP to take the SQL statement results and feed them into an array and 
count the distinct cardnums for each date and then spit it all into an 
html table.  thanks

On Wed, 21 Apr 2004, Daniel 
Clark wrote:

 AND: any count =1 shows they came in that day.
 
 How about:
 
 SELECT convert( varchar,eventime,110) as date from events, badge,
count(convert( varchar,eventime, 110)) as count
 WHERE events.cardnum = badge.id and devid = '1' and
convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate'
 AND type = '1'
 GROUP BY convert( varchar,events.eventime, 110), badge
 
 
  I'm using some proprietary software/hardware where when a visitor swipes
  their entry card, it is recorded in a mssql 2000 server.  My boss wants a
  count of unique vistors for a range of dates.  So, I need to have it give
  a count of unique vistors, meaning that I need to count all vists for a
  day as one visit (because if they go outside to smoke and come back and
  swipe their card again to get in, each one is a separate visit, but i need
  to count all visits by each person as one visit since i just want to know
  if they came at all each day, not how many times they came in).
 
  This is my SQL statement:
 
  select distinct count(convert( varchar,eventime, 110)) as count,
  convert( varchar,eventime,110) as date from events, badge wher
  events.cardnum = badge.id and devid = '1' and
  convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 'enddate'
  and type = '1' group by convert( varchar,events.eventime, 110)
 
  for reference, devid = '1' is the hardware device, where everytime it
  triggers, it means someone swiped their card to get in, and type = '1'
  means patron (because we have a type = 2 that is for staff and we jsut
  want to know how many patrons visited)
 
  When I execute this statement, its returning the result for each date of
  the total number of card swipes (so if a person comes in twice on a date,
  its recording it as 2 swipes, but I just need to know that they came to
  the building at all on this date, so I just need it to register that there
  was a count of atleast one for this card that was swiped)
 
  any suggestions?  thanks
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

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



Re: [PHP-DB] logic problem

2004-04-21 Thread Adam Williams
Re-read my original email, I'm using mssql and not mysql.  I'm sort 
of close to having it working with the sql statement i posted earlier and 
using PHP to figure out if the date has changed or not and to count the 
cardnum if the date hasn't changed.  I'm getting a number that is 
different then the total number multiple visits by patrons, haven't 
checked with the registration person if the # I am getting is right or 
not, because for some of the very early dates when we were testing the 
equipment, it returns a count of 0 visits by type 1 card users, even 
though they have a count of 15 multiple entries that day, so something 
weird is still going on.  i think i'm going to have to end up using a 
multidimensional array and having PHP loop through it or something...

On Wed, 21 Apr 2004, Brent Baisley wrote:

 This seems too easy to not be able to do it with SQL. There must be 
 something we're missing in the query.
 Try this:
 
 select distinct badge.id,convert( varchar,eventime,110) as date,count(*)
 from events, badge where
 events.cardnum = badge.id and devid = '1' and
 convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 
 'enddate'
 and type = '1'
 group by date
 
 In MySQL you don't need to specify a field for count(). And you should 
 have to convert the eventime field twice, you should be able to 
 reference the calc field in the group by.
 
 On Apr 21, 2004, at 2:19 PM, Adam Williams wrote:
 
  Yeah I basically had that with my previous SQL statement, I was 
  grouping
  by event.cardnum instead of counting the cardnums by date.  I think 
  what
  I'm trying to do is beyond the scope of SQL and I'll have to write some
  PHP to take the SQL statement results and feed them into an array and
  count the distinct cardnums for each date and then spit it all into an
  html table.  thanks
 
  On Wed, 21 Apr 2004, Daniel
  Clark wrote:
 
  AND: any count =1 shows they came in that day.
 
  How about:
 
  SELECT convert( varchar,eventime,110) as date from events, badge,
 count(convert( varchar,eventime, 110)) as count
  WHERE events.cardnum = badge.id and devid = '1' and
 convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 
  'enddate'
  AND type = '1'
  GROUP BY convert( varchar,events.eventime, 110), badge
 
 
  I'm using some proprietary software/hardware where when a visitor 
  swipes
  their entry card, it is recorded in a mssql 2000 server.  My boss 
  wants a
  count of unique vistors for a range of dates.  So, I need to have it 
  give
  a count of unique vistors, meaning that I need to count all vists 
  for a
  day as one visit (because if they go outside to smoke and come back 
  and
  swipe their card again to get in, each one is a separate visit, but 
  i need
  to count all visits by each person as one visit since i just want to 
  know
  if they came at all each day, not how many times they came in).
 
  This is my SQL statement:
 
  select distinct count(convert( varchar,eventime, 110)) as count,
  convert( varchar,eventime,110) as date from events, badge wher
  events.cardnum = badge.id and devid = '1' and
  convert( varchar, events.eventime, 110) BETWEEN '$startdate' and 
  'enddate'
  and type = '1' group by convert( varchar,events.eventime, 110)
 
  for reference, devid = '1' is the hardware device, where everytime it
  triggers, it means someone swiped their card to get in, and type = 
  '1'
  means patron (because we have a type = 2 that is for staff and we 
  jsut
  want to know how many patrons visited)
 
  When I execute this statement, its returning the result for each 
  date of
  the total number of card swipes (so if a person comes in twice on a 
  date,
  its recording it as 2 swipes, but I just need to know that they came 
  to
  the building at all on this date, so I just need it to register that 
  there
  was a count of atleast one for this card that was swiped)
 
  any suggestions?  thanks
 
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 

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



Re: [PHP-DB] logic problem

2004-04-21 Thread Adam Williams
Still doesn't work the way I want it.  My boss is taking a look at it, she 
knows SQL really well, I was trying to do this without her assistance, but 
its just harder then I was expecting.  thanks for the help tho

On Wed, 21 Apr 2004, Daniel Clark wrote:

 How about
 
 SELECT distinct badge.id, convert( varchar,eventime,110) as date
 
 Shows all the badge numbers IN on that date.   If the badge number is not
 there, they didn't check in at ALL that day.
 
 
  This seems too easy to not be able to do it with SQL. There must be
  something we're missing in the query.
  Try this:
 
  select distinct badge.id,convert( varchar,eventime,110) as date,count(*)
  from events, badge where
  events.cardnum = badge.id and devid = '1' and
  convert( varchar, events.eventime, 110) BETWEEN '$startdate' and
  'enddate'
  and type = '1'
  group by date
 
  In MySQL you don't need to specify a field for count(). And you should
  have to convert the eventime field twice, you should be able to
  reference the calc field in the group by.
 
  On Apr 21, 2004, at 2:19 PM, Adam Williams wrote:
 
  Yeah I basically had that with my previous SQL statement, I was
  grouping
  by event.cardnum instead of counting the cardnums by date.  I think
  what
  I'm trying to do is beyond the scope of SQL and I'll have to write some
  PHP to take the SQL statement results and feed them into an array and
  count the distinct cardnums for each date and then spit it all into an
  html table.  thanks
 
  On Wed, 21 Apr 2004, Daniel
  Clark wrote:
 
  AND: any count =1 shows they came in that day.
 
  How about:
 
  SELECT convert( varchar,eventime,110) as date from events, badge,
 count(convert( varchar,eventime, 110)) as count
  WHERE events.cardnum = badge.id and devid = '1' and
 convert( varchar, events.eventime, 110) BETWEEN '$startdate' and
  'enddate'
  AND type = '1'
  GROUP BY convert( varchar,events.eventime, 110), badge
 
 
  I'm using some proprietary software/hardware where when a visitor
  swipes
  their entry card, it is recorded in a mssql 2000 server.  My boss
  wants a
  count of unique vistors for a range of dates.  So, I need to have it
  give
  a count of unique vistors, meaning that I need to count all vists
  for a
  day as one visit (because if they go outside to smoke and come back
  and
  swipe their card again to get in, each one is a separate visit, but
  i need
  to count all visits by each person as one visit since i just want to
  know
  if they came at all each day, not how many times they came in).
 
  This is my SQL statement:
 
  select distinct count(convert( varchar,eventime, 110)) as count,
  convert( varchar,eventime,110) as date from events, badge wher
  events.cardnum = badge.id and devid = '1' and
  convert( varchar, events.eventime, 110) BETWEEN '$startdate' and
  'enddate'
  and type = '1' group by convert( varchar,events.eventime, 110)
 
  for reference, devid = '1' is the hardware device, where everytime it
  triggers, it means someone swiped their card to get in, and type =
  '1'
  means patron (because we have a type = 2 that is for staff and we
  jsut
  want to know how many patrons visited)
 
  When I execute this statement, its returning the result for each
  date of
  the total number of card swipes (so if a person comes in twice on a
  date,
  its recording it as 2 swipes, but I just need to know that they came
  to
  the building at all on this date, so I just need it to register that
  there
  was a count of atleast one for this card that was swiped)
 
  any suggestions?  thanks
 
 

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



[PHP-DB] Need some HELP

2004-05-10 Thread Adam Farid
Hi,

I am  a new to php. I am using php ver 4.0.3 and MySQL.

I have wrote two files and I'd like to pass some varaibles from first file 
to use them in the second file.
but  the values did not displayed in the second file(nothing print out). and 
also I want to pass them to anothr file ...  here is what I've wrote :

 file1.php**
?php
.
$username=A;
$user_num=123;
$user_addres=User Address;
print FORM action='file2.php' method=post;
	print input type=submit value='send';
   print INPUT TYPE='hidden' NAME='UserName' 
VALUE='$username'\n;
   print input type=hidden name=UserNum' value='$user_num';
   print input type=hidden name='Addrress' 
value='$user_addres';
  	print /td;
   print /FORM/tr;

?

** second file file2.php 
?php

?
FORM action='anothrfile.php' method=post
table
?
print INPUT TYPE='hidden' NAME='User_name' VALUE='$UserName';
print input type=hidden name=User_Num' value='$UserNum';
print input type=hidden name='User_Addres' value='$Address';
?
   trth align=left Name:/thtd ? print $User_name; ?/td/tr
   trth align=left User Number:/thtd  ? print $User_Num; 
?/td/tr
   trth align=left Address:/th td ? print$User_Addres; 
?/td/tr
...
input type=submit value='submit'
/table
/FORM
..

Kind Regrads
Adam
I hope someone  can help me. Thanks
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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


[PHP-DB] Need some HELP (not works)

2004-05-10 Thread Adam Farid
Thanks pepole.

I've tried but still does not work.

when I put the varaibles name between ' '

I found this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or 
`T_NUM_STRING'.

I typed in this way

 print INPUT TYPE='hidden' NAME='User_name' 
VALUE='$_POST[UserName]'; 

but nothing  a new.

I have checked  register_globals is on.
in my first page I used session_start(); and   global $HTTP_SESSION_VARS;
I dont know if this cause the problem that I had.
Thanks again and more help please.
Adam
_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

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


[PHP-DB] Need some HELP (not works)

2004-05-10 Thread Adam Farid
Thanks.

I tried your suggestion, but  the values still did not displayed in second 
page.
nothing printed out.

I put my files in db-list (Need some HELP).

regards
Adam
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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


[PHP-DB] oracle error ORA-12154

2004-07-16 Thread Adam Williams
Hi, I'm trying to connect to an oracle 9.20 database using:

$conn = OCILOGON(dah50,dah50,zed2.aleph0);

but I get the error ORA-12154

Searching on google says my listener.ora or tnsnames.ora may have 
problems, but I think mine are correct.  Can someone take a look and see 
if they are ok?  Also, I can connect to the database from the command 
line:

ORACLEsqlplus dah50/[EMAIL PROTECTED]

SQL*Plus: Release 9.2.0.3.0 - Production on Fri Jul 16 11:58:49 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production


so I'm not really sure what is going on.  below are my tnsnames.ora and 
listener.ora:


tnsnames.ora


zed2.aleph0=(description=
(address=
(protocol=ipc)
(key=aleph0))
(address=
(protocol=tcp)
(host=zed2.mdah.state.ms.us)
(port=1521))
(connect_data=(service_name=aleph0)(server=DEDICATED)))



listener.ora


listener=(description=
(address_list=
(address =
(protocol = ipc)
(key = extproc))
(address=
(protocol=ipc)
(key=aleph0))
(address=
(protocol=tcp)
(host=zed2.mdah.state.ms.us)
(port=1521))
)
   )

sid_list_listener=(sid_list=
(sid_desc=
(global_name=aleph0)
(sid_name=aleph0)
(oracle_home=/exlibris/app/oracle/product/920)
)
(sid_desc =
(sid_name = extproc)
(oracle_home=/exlibris/app/oracle/product/920)
(program = extproc)
)
  )
startup_wait_time_listener=0
connect_timeout_listener=20
trace_level_listener=off




and when I start the listener I get no errors.

ORACLElsnrctl stop ; lsnrctl start

LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc)))
The command completed successfully

LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Starting /exlibris/app/oracle/product/920/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 9.2.0.3.0 - Production
System parameter file is 
/exlibris/app/oracle/product/920/network/admin/listener.ora
Log messages written to 
/exlibris/app/oracle/product/920/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0)))
Listening on: 
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521)))

Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc)))
STATUS of the LISTENER

Alias LISTENER
Version   TNSLSNR for Linux: Version 9.2.0.3.0 - 
Production
Start Date16-JUL-2004 12:07:11
Uptime0 days 0 hr. 0 min. 0 sec
Trace Level   off
Security  OFF
SNMP  OFF
Listener Parameter File   
/exlibris/app/oracle/product/920/network/admin/listener.ora
Listener Log File 
/exlibris/app/oracle/product/920/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0)))
  
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521)))
Services Summary...
Service aleph0 has 1 instance(s).
  Instance aleph0, status UNKNOWN, has 1 handler(s) for this service...
Service extproc has 1 instance(s).
  Instance extproc, status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

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



Re: [PHP-DB] oracle error ORA-12154

2004-07-16 Thread Adam Williams
yeah I got it to work, i had to do putenv() with my oracle home dir and 
then my scripts started working.  thanks

Peter Beckman wrote:
The biggest problem with oci8 is having these four variables set:
$ORACLE_SID=SOMESID
$ORACLE_HOME=/home/beckman/oracle
$ORACLE_BASE=/home/beckman/oracle
$TNS_ADMIN=/home/beckman/oracle/network/admin
If those aren't set, then things won't work.
Please confirm that those environment variables are set in Apache or
whatever web server you are using.  If they aren't, oci8 won't work.
Beckman
On Fri, 16 Jul 2004, Adam Williams wrote:
 

Hi, I'm trying to connect to an oracle 9.20 database using:
$conn = OCILOGON(dah50,dah50,zed2.aleph0);
but I get the error ORA-12154
Searching on google says my listener.ora or tnsnames.ora may have
problems, but I think mine are correct.  Can someone take a look and see
if they are ok?  Also, I can connect to the database from the command
line:
ORACLEsqlplus dah50/[EMAIL PROTECTED]
SQL*Plus: Release 9.2.0.3.0 - Production on Fri Jul 16 11:58:49 2004
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
so I'm not really sure what is going on.  below are my tnsnames.ora and
listener.ora:
tnsnames.ora

zed2.aleph0=(description=
   (address=
   (protocol=ipc)
   (key=aleph0))
   (address=
   (protocol=tcp)
   (host=zed2.mdah.state.ms.us)
   (port=1521))
   (connect_data=(service_name=aleph0)(server=DEDICATED)))

listener.ora

listener=(description=
   (address_list=
   (address =
   (protocol = ipc)
   (key = extproc))
   (address=
   (protocol=ipc)
   (key=aleph0))
   (address=
   (protocol=tcp)
   (host=zed2.mdah.state.ms.us)
   (port=1521))
   )
  )
sid_list_listener=(sid_list=
   (sid_desc=
   (global_name=aleph0)
   (sid_name=aleph0)
   (oracle_home=/exlibris/app/oracle/product/920)
   )
   (sid_desc =
   (sid_name = extproc)
   (oracle_home=/exlibris/app/oracle/product/920)
   (program = extproc)
   )
 )
startup_wait_time_listener=0
connect_timeout_listener=20
trace_level_listener=off

and when I start the listener I get no errors.
ORACLElsnrctl stop ; lsnrctl start
LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11
Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc)))
The command completed successfully
LSNRCTL for Linux: Version 9.2.0.3.0 - Production on 16-JUL-2004 12:07:11
Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.
Starting /exlibris/app/oracle/product/920/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.3.0 - Production
System parameter file is
/exlibris/app/oracle/product/920/network/admin/listener.ora
Log messages written to
/exlibris/app/oracle/product/920/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0)))
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521)))
Connecting to (DESCRIPTION=(address=(protocol=ipc)(key=extproc)))
STATUS of the LISTENER

Alias LISTENER
Version   TNSLSNR for Linux: Version 9.2.0.3.0 -
Production
Start Date16-JUL-2004 12:07:11
Uptime0 days 0 hr. 0 min. 0 sec
Trace Level   off
Security  OFF
SNMP  OFF
Listener Parameter File
/exlibris/app/oracle/product/920/network/admin/listener.ora
Listener Log File
/exlibris/app/oracle/product/920/network/log/listener.log
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=aleph0)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=zed2.mdah.state.ms.us)(PORT=1521)))
Services Summary...
Service aleph0 has 1 instance(s).
 Instance aleph0, status UNKNOWN, has 1 handler(s) for this service...
Service extproc has 1 instance(s).
 Instance extproc, status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http

[PHP-DB] SQLite security

2004-08-16 Thread Adam Q
I would like to use an SQLite DB for the prefs for an open source PHP 
project, but I can't find any way to be sure the DB file is going to be 
secure... Is it possible to encrypt a SQLite DB file?

With the current setup, if I include a .htaccess for the DB dir, this 
will only work for Apache - not IIS.
I know I can include a warning about how important it is to place the 
files outside the HTTP directory tree and .htaccess files are good, but 
it is just too easy to download an SQLite DB... I can't really see any 
PHP use that would be OK for this really.
if I put the db file SQLITE.DB into /www/db
Anybody can d/l it by typing
http://myserver.com/db/SQLITE.DB

I though I might even be able to prevent d/l by naming the DB file with 
a . at the start but it makes do difference.

... and if the project is open source it is just too much of a security 
risk as everybody knows where the file is going to be on a default 
installation.

Otherwise I'm stuck with the standard PHP prefs file confing.inc.php 
(- which is safe from prying eyes):
?
if (defined(correct_entry_point)) {
my_pref[1] = lots of good stuff;
}
?

But updating this on pref changes is no fun compared to SQLite
shrug
Please somebody tell me I'm wrong,
Cheers,
Adam
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] SQLite security

2004-08-20 Thread Adam Q
You can use Mcrypt, OpenSSL or any other crypographic provider to 
encrypt
the information however for your application to be able to access the
information you would also have to store the encryption key, reducing 
the
protection offered.
Any PHP MySQL connection script has the DB password in it somewhere so 
this is not an issue I think.
phpMyAdmin allows you to put the password into a config file...
But you can't download a MySQL database by typing in a URL.

I think encryption for SQLite is essential for PHP. It makes it almost 
useless in a webscripting language.
Suppose you wanted to create an open source, easily portable, file 
based guestbook in PHP. I would never use SQLLite under the current 
circumstances... Although I would love to. It seems like the perfect 
solution.

But the database needs a password otherwise it is just too much of 
a security risk.

SQLite is intended for applications that need a database but don't 
need a
full fledged solution such as PostgreSQL
I can't think of one (1) web based application where I would recommend 
SQLite - if I can't specify a password for access.
Maybe for PHP-GTK, but that is not web based (and PHP is used a great 
deal for web scripting).

Remember regardless of the database you use if you are using a shared
hosting provider it is possible othere hosting clients will be able to
access your database regardless of the engine you use.
Shared hosting vulnerabilities have nothing to do with SQLite security.
phpMyAdmin seems to be a popular choice for MySQL admin and I reckon 
there must be a few people who use it in shared hosting situations.

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


[PHP-DB] Unable to Login to Oracle 9i-R2 Database Using PHP 5.2.5

2008-11-24 Thread Fortuno, Adam
All:

I'm running PHP in ISAPI mode with IIS accessing (or attempting to
access) an Oracle 9i database on a RedHat box. Here are the versions of
everything:

Web Server: IIS v5.1
PHP: 5.2.5
Database: ORACLE v9i-R2

I am attempting to load a page with the following code:

//Database credentials
$username = MyUser;
$passwd = MyPassword;
$db=DBName;

//Return the database connection
OCILogon($username, $passwd, $db);

I receive an error stating, Fatal error: Call to undefined function
OCILogon() in C:\Documents and Settings\afortuno\My
Documents\Dev\DBAIntranet\ghr_resources\transaction_report\adam.php on
line 7

I'm able to use SQL Plus to login to the database I'm interested in.
This gives me the impression that my credentials are not the problem;
however, the plumbing between PHP and Oracle is the culprit. 

I initially had problems loading the OCI extension DLL. I resolved the
issue by installing the Oracle 10g instant client. Here are the steps I
followed as part of that process:

(1) Download Oracle Instant Client Package Basic (v10.2.0.4) for Win32

http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/
winsoft.html

(2) Unzip the contents downloaded zip-file.
(3) Move the folder to the C:\Oracle directory.
(4) Add the new folder (C:\oracle\ora102ic) to the PATH.
(5) Restart IIS (e.g., C:\ iisreset).

The error message couldn't be more vague, and I'm not experienced enough
with Oracle, IIS, or PHP to know where to turn for more insight. Any
help would be appreciated.

Cheers,
Adam


RE: [PHP-DB] Unable to Login to Oracle 9i-R2 Database Using PHP 5.2.5

2008-11-24 Thread Fortuno, Adam
Chris/Rick,

Thank you both for the notes. I sincerely appreciate the help.

Chris, I've got a php_oci8.dll file sitting in my extensions directory
(C:\php\ext) - see below.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=
 Console Output
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

C:\PHP\extdir
Volume in drive C has no label.
Volume Serial Number is 84DF-21C4

Directory of C:\PHP\ext

11/24/2008  02:59 PMDIR  .
11/24/2008  02:59 PMDIR  ..
11/08/2007  11:23 PM41,019 php_crack.dll
11/08/2007  11:23 PM28,732 php_ntuser.dll
11/08/2007  11:23 PM   102,458 php_oci8.dll
  3 File(s)172,209 bytes
  2 Dir(s)  40,158,838,784 bytes free

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

As best I can tell, I've correctly set my extensions directory
(C:\php\ext) and I've called the oci8 DLL correctly - see below.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=
 php.ini Snipet
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

C:\PHP\exttype ..\php.ini | grep -in php_oci
1293:[PHP_OCI8]
1294:extension=php_oci8.dll

C:\PHP\exttype ..\php.ini | grep -in \\ext
536:extension_dir =C:\PHP\ext

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

Let me know if I've mucked that up.

Rick, when I delve into the php_info() shmaz, I see this snipet - see
below. I'm not sure if I should be looking for something else or not.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=
 PHP information
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

C:\PHP\extphp -i

...stuff...

oci8

OCI8 Support = enabled
Version = 1.2.4
Revision = $Revision: 1.269.2.16.2.38 $
Active Persistent Connections = 0
Active Connections = 0
Temporary Lob support = enabled
Collections support = enabled

Directive = Local Value = Master Value
oci8.default_prefetch = 10 = 10
oci8.max_persistent = -1 = -1
oci8.old_oci_close_semantics = 0 = 0
oci8.persistent_timeout = -1 = -1
oci8.ping_interval = 60 = 60
oci8.privileged_connect = Off = Off
oci8.statement_cache_size = 20 = 20

...other stuff...

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=

If I take the page that is generating the error and move it to my Redhat
box running PHP 5.0.2, I have no problem. If I use it locally, I get the
error. 

What am I missing here?

Cheers,
A-


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2008 4:56 PM
To: Fortuno, Adam
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Unable to Login to Oracle 9i-R2 Database Using PHP
5.2.5


 //Return the database connection
 OCILogon($username, $passwd, $db);
 
 I receive an error stating, Fatal error: Call to undefined function
 OCILogon() in C:\Documents and Settings\afortuno\My
 Documents\Dev\DBAIntranet\ghr_resources\transaction_report\adam.php on
 line 7

snip

 The error message couldn't be more vague, and I'm not experienced
enough
 with Oracle, IIS, or PHP to know where to turn for more insight. Any
 help would be appreciated.

The error is pretty clear.

You're trying to call a function that doesn't exist.

Tracing it backwards, the php_oci.dll (or php_oci8.dll) isn't being
loaded.

Search for oci8 here: http://pecl4win.php.net/

and grab the dll file.

There are some notes 
http://www.php.net/manual/en/install.windows.extensions.php about how to

install this.

-- 
Postgresql  php tutorials
http://www.designmagick.com/


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



RE: [PHP-DB] Unable to Login to Oracle 9i-R2 Database Using PHP 5.2.5

2008-11-26 Thread Fortuno, Adam
Chris/Rick/Neil,

I put together a test page (test.php) with content ?php php_info(); ?.
When the page is displayed, I don't see anything related to OCI8. To
Rick's point, the module isn't being uploaded. I believe I know why it
isn't loading. I don't believe the ISAPI PHP module is loading the right
PHP.ini (ini) file. When I run php at the CLI, it loads the ini in the
same directory as PHP's executable (c:\php\) i.e., it loads
c:\php\php.ini. 

C:\php --ini
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\PHP\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:  (none)

When I look at the php information displayed by my test page, it looks
like php is looking for an ini-file in the C:\Windows\ directory.

Configuration File (php.ini) Path - C:\WINDOWS
Loaded Configuration File - (none)

This gets better. When process the page on the CLI (e.g., php -f
file), it processes without an issue. As stated before, it (the same
page) fails when processed thru IIS.

I need to do some more work to get this fixed, but your comments were a
big help. Thanks! 

A-

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 24, 2008 5:54 PM
To: Fortuno, Adam
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Unable to Login to Oracle 9i-R2 Database Using PHP
5.2.5


 Rick, when I delve into the php_info() shmaz, I see this snipet - see
 below. I'm not sure if I should be looking for something else or not.

Try doing this from a web page. Maybe it has a different php.ini or 
something.

Anything in the IIS error log (probably goes to the windows logs) ?

-- 
Postgresql  php tutorials
http://www.designmagick.com/


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



RE: [PHP-DB] re:database tables relations advice

2008-11-27 Thread Fortuno, Adam
Mr. Froasty,

From your note, it sounds like you want to use foreign keys; as Daniel
pointed out. I think an example would be helpful here. The subject of
foreign keys is bigger than a bread box so I'll just touch on the pieces
I think you'll find helpful. There is all sorts of literature scattered
about the web if you want to know more. Let's start with a fictional
case:

I work for a company with multiple departments each of which have one or
more employees. I would like a relational data structure to capture
departmental and employee information as well as preserve the
relationship between the two.

Make sense?

I create two tables: `Department` and `Employee`. Each table has a
primary key (as you illustrated in your example), which is unique per
record. importantI add a column in Employee that holds the primary key
of the employee's associated department/important. I then create a
relation between the two tables to indicate there is a relationship.

--Create the Department table
CREATE TABLE Department (
IDDepartment INT NOT NULL AUTO_INCREMENT, 
Name VARCHAR(35),
PRIMARY KEY (IDDepartment)
) ENGINE = InnoDB;

--Create the Employee table and simultaneously the 
--relation to Department
CREATE TABLE Employee (
IDEmployee INT NOT NULL AUTO_INCREMENT, 
idDepartment INT NOT NULL,
Name VARCHAR(35),
PRIMARY KEY (IDEmployee),
INDEX IDX_idDepartment (idDepartment),
FOREIGN KEY (idDepartment) REFERENCES Department(idDepartment) 
 ON DELETE CASCADE
 ON UPDATE CASCADE
) ENGINE = InnoDB;

MySQL can do all of this provided you're using the InnoDB storage
engine. MySQL's documentation has some helpful information on the
subject - see link below.

http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-foreign-keys.html

With me so far?

A few points specific to MySQL:

(1) Whatever field you chose as your foreign key, needs an index.
(2) You can add foreign keys after a table has been created using an
ALTER statement.
(3) The option ON DELETE CASCADE means that whenever the parent record
(i.e., the department) is deleted the related employees will be deleted
too.
(4) The option ON UPDATE CASCADE means that whenver the parent's key
record (i.e., the department) is updated the related foreign key record
will be updated too.
(5) There are options other than ON UPDATE and ON DELETE. Give'm a look.

Good luck, and welcome to the DB development club.

Cheers,
Adam

-Original Message-
From: mrfroasty [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 27, 2008 5:19 AM
To: php-db@lists.php.net
Subject: [PHP-DB] re:database tables relations advice

I am quite new to database designs, I have a problem in my design...I
can actually feel it, but I am not quite sure if there is a feature in
mysql or I have to solve it with programming.

Example:
CREATE TABLE A (
user_id int(16) NOT NULL auto_increment,
..other datas
PRIMARY KEY (user_id)
   );

CREATE TABLE B (
user_id int(16) NOT NULL auto_increment,
..other datas
PRIMARY KEY (contact_id)
);

Question:
How can I declare that the user_id in my 1st table is related to user_id
in the 2nd table...actually I prefer to have it exactly the same user_id
in both tablesI think if those 2 entries are the same it will be
great, but I am not sure how to achieve this.

P:S
-Ofcourse I know that I can extract it from TABLE A and save it in TABLE
Bbut is that a way to go???Because this issue arise in couple of
tables in my data structure that I am tending to use in my
application(web).
-I also know that its possible to  make just 1 big table with lots of
columnsbut I read its not a good database design...

-please advice, running out of ideas :-(

Thanks..


-- 
Extra details:
OSS:Gentoo Linux-2.6.25-r8
profile:x86
Hardware:msi geforce 8600GT asus p5k-se
location:/home/muhsin
language(s):C/C++,VB,VHDL,bash
Typo:40WPM
url:http://mambo-tech.net


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


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



RE: [PHP-DB] Re: MS SQL error...I've come a long way to get this far

2008-12-08 Thread Fortuno, Adam
Fred,

If you're using integrated security (e.g., a domain account such as
domain\bob), you won't supply a password. However, the sa account is
a SQL login (v.s. a domain login). In that case, it would make sense
that you supply a password. See the following page for some code to
connect using integrated security:

http://msdn.microsoft.com/en-us/library/cc296205(SQL.90).aspx

See the following page for some code to connect using a SQL login:

http://msdn.microsoft.com/en-us/library/cc296182(SQL.90).aspx

If you're curious if this is even an authentication/permissions issue,
try to login using a domain login. The login event will be recorded in
the `Event Viewer`. If you're attempt isn't recorded, you've got a
communication problem with the server instance. If it is recorded,
you'll be able to tell what the problem is authenticating.

Good luck, and let us know how it turns out.

A-


-Original Message-
From: Fred Silsbee [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 3:30 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Re: MS SQL error...I've come a long way to get this
far

I was just thinking about something I've never understood completely!

mssql_connect($server, 'sa', 'PW'); presumes the server doesn't have all
the permissions in spite of the fact that it has the password.

The password I gave is the XP Prof login PW.

Maybe some other PW. 


--- On Mon, 12/8/08, Fred Silsbee [EMAIL PROTECTED] wrote:

 From: Fred Silsbee [EMAIL PROTECTED]
 Subject: MS SQL error...I've come a long way to get this far
 To: php-db@lists.php.net
 Date: Monday, December 8, 2008, 7:13 PM
 many changes to php.ini to get this far..whew!
 
 PHP 5.2.7 just got jerked out from underneathe me (I
 have't replaced it since this is a simple script)
 
 phpinfo works!
 
 ?php
 // Server in the this format:
 computer\instance name or 
 // server,port when using a non default
 port number
 $server = 'LANDON\SQLEXPRESS';
 
 $link = mssql_connect($server, 'sa', 'PW');
line 6
 
 if(!$link)
 {
 die('Something went wrong while connecting to
 MSSQL');
 }
 ?
 
 
 Warning: mssql_connect() [function.mssql-connect]: Unable
 to connect to server: LANDON\SQLEXPRESS in
 C:\Inetpub\wwwroot\trymssql.php on line 6
 Something went wrong while connecting to MSSQL


  


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


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



RE: [PHP-DB] MySQL Conditional Trigger

2008-12-08 Thread Fortuno, Adam
Dee,

If all you're trying to code is that a value of NULL equates to FALSE
and a date value (whatever date value) equates to true, you can use
something like this:

If ($MyVariable) {
//... true path blah...
} else {
//... false path blah...
}

You can use this because NULL equates to false. If you prefer something
more concise, try the following:

$MyVariable ? //True : //False

I'm not a PHP guy so take this with a grain of salt. If I'm full of it,
don't hesitate to correct me.

A-

-Original Message-
From: OKi98 [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 4:33 PM
To: Dee Ayy
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] MySQL Conditional Trigger

 Original Message  
Subject: [PHP-DB] MySQL Conditional Trigger
From: Dee Ayy [EMAIL PROTECTED]
To: php-db@lists.php.net
Date: 31.10.2008 17:09
 I don't think my trigger likes a comparison with a variable which is
 NULL.  The docs seem to have a few interesting variations on playing
 with NULL and I was hoping someone would just throw me a fish so I
 don't have to try every permutation (possibly using CASE, IFNULL,
 etc.).

 If my ShipDate (which is a date datatype which can be NULL) changes to
 a non-null value, I want my IF statement to evaluate to TRUE.
 IF NULL changes to aDate : TRUE
 IF aDate changes to aDifferentDate : TRUE
 IF anyDate changes to NULL : FALSE

 In my trigger I have:
 ...
 IF OLD.ShipDate != NEW.ShipDate AND NEW.ShipDate IS NOT NULL THEN
 ...

 Which only works when ShipDate was not NULL to begin with.
 I suppose it evaluates the following to FALSE
 IF NULL != '2008-10-31' AND '2008-10-31' IS NOT NULL THEN
 (not liking the NULL != '2008-10-31' part)

 Please give me the correct syntax.
 TIA

   
anything compared to NULL is always false
NULL = NULL (NULL included) =  false
NULL != anything (NULL included) = false
that's why IS NULL exists

I would go this way:

IF NVL(OLD.ShipDate, -1) != NVL(NEW.ShipDate, -1) THEN




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


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



RE: [PHP-DB] MySQL Conditional Trigger

2008-12-08 Thread Fortuno, Adam
All,

Chris makes a good point i.e., unknown compared to anything is
unknown. His comment made me want to clarify my earlier note. In my
earlier example, I wasn't suggesting that-that logic be coded in the
database. I was assuming it would be in the page:

?php

$TestNullValue = NULL;

If ($TestNullValue) {
print Evaluates to true!;
} else {
print Evaluates to false!;
}

?

I tested this, and it worked. Here is why, PHP (like pretty much every
other language) silently casts a NULL to false: 

When converting to boolean, the following values are considered FALSE:

 - the boolean FALSE itself 
 - the integer 0 (zero) 
 - the float 0.0 (zero) 
 - the empty string, and the string 0 
 - an array with zero elements 
 - an object with zero member variables (PHP 4 only)
 - the special type NULL (including unset variables) (Booleans,
php.net, 05 Dec. 2008).

If you were going to code it in the database, I'd suggest something like
this:

--Using T-SQL here...
DECLARE @TestNullValue SMALLDATETIME

SET @TestNullValue = NULL

If (@TestNullValue Is Null) 
 PRINT 'Evaluates to true!';
ELSE
 PRINT 'Evaluates to false!';

In either case, this should have the same net result.

Be Well,
A-

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 08, 2008 5:10 PM
To: OKi98
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] MySQL Conditional Trigger


 anything compared to NULL is always false

Actually it's null.

mysql select false = null;
+--+
| false = null |
+--+
| NULL |
+--+
1 row in set (0.01 sec)

mysql select 1 = null;
+--+
| 1 = null |
+--+
| NULL |
+--+
1 row in set (0.00 sec)

mysql select 2 = null;
+--+
| 2 = null |
+--+
| NULL |
+--+
1 row in set (0.00 sec)


unknown compared to anything is unknown.

-- 
Postgresql  php tutorials
http://www.designmagick.com/


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


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



RE: [PHP-DB] Re: session variable in select query showing picture from database

2009-02-12 Thread Fortuno, Adam
Mika,

Put the dollar sign (i.e., $) outside the curly brace.

$query=SELECT * FROM pic_upload WHERE band_id='${band_id}';

A-

-Original Message-
From: Mika Jaaksi [mailto:mika.jaa...@gmail.com] 
Sent: Thursday, February 12, 2009 12:27 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Re: session variable in select query showing picture
from database

Still fighting with it...

So, these work:

$query=SELECT * FROM pic_upload;
$query=SELECT * FROM pic_upload WHERE band_id=11;
picture is shown on the other page

but when adding variable into query it doesn't show the picture on the
other
page
$query=SELECT * FROM pic_upload WHERE band_id='{$band_id}';

I'm out of ideas at the moment...

ps. forget what I said about the weird markings...


2009/2/12 Mika Jaaksi mika.jaa...@gmail.com

 I'm trying to show picture from database. Everything works until I add
 variable into where part of the query.

 It works with plain number. example ...WHERE id=11... ...picture is
shown
 on the page.

 Here's the code that retrieves the picture. show_pic.php

 ?php
 function db_connect($host='', $user='',
 $password='', $db='')
 {
 mysql_connect($host, $user, $password) or die('I cannot connect to db:
' .
 mysql_error());
 mysql_select_db($db);
 }
 db_connect();
 $band_id = $_SESSION['session_var'];
 $query=SELECT * FROM pic_upload WHERE band_id=$band_id;
 $result=mysql_query($query);
 while($row = mysql_fetch_array($result))
 {
 $bytes = $row['pic_content'];
 }
 header(Content-type: image/jpeg);
 print $bytes;


 exit ();
 mysql_close();
 ?


 other page that shows the picture

 ?php
 echo img width='400px' src='./show_pic.php' /;
 ?

 Any help would be appreciated...

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



RE: [PHP-DB] Retrieving Image Location in MySQL

2009-03-02 Thread Fortuno, Adam
Sashi,

This (likely) means you have a some generic page (i.e., picture.php)
that displays some picture. The picture it displays depends on the
parameter passed when the page is called (i.e., 123).

html
head
titleSashi's Test Page/title
/head
body
?php

$value = $_GET ['qry'];

//Get your parameter
if (!$value) die(Uh oh, trying to call the page without
a valid qry value.);

//Write a query to pull out the picture's path
$sql = SELECT path FROM Image WHERE ID = %s;
mysql_real_escape_string($value);

//Execute the query
$output = mysql_query($sql);

//Display the corresponding picture
while ($row = mysql_fetch_assoc($output)) {
printf(img src=\%s\ /, $row['firstname']);
}

//Clean up
mysql_free_result($output);

?
/body
/html

Please note, I haven't tried this. It just seems plausible.

Good luck.

A-

-Original Message-
From: Sashikanth Gurram [mailto:sashi...@vt.edu] 
Sent: Sunday, March 01, 2009 10:27 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Retrieving Image Location in MySQL

Dear All,

I am trying to retrieve the location of a image (not the image, just the

location of the image) stored on MySQL database, using PHP to display it

in my browser. One of the users has been kind enough to provide me with 
an example code as to how to do it. He asked me to use /img 
src=picture.php?qry=123 /in the html code. I understood the part of 
/picture.php? /which tells us that the php code used to retrieve the 
image is located in the file picture.php (If what I have understood is 
correct). But I did not quite understand the second part /qry=123 /. 
What does this mean? Of what use is this second part? Does the variable 
qry has something assigned to it in the picture.php code? I would 
greatly appreciate it if any one of you can answer my questions.

Thanks,
Sashi

-- 
~
~
Sashikanth Gurram
Graduate Research Assistant
Department of Civil and Environmental Engineering
Virginia Tech
Blacksburg, VA 24060, USA


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


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



RE: [PHP-DB] Retrieving Image Location in MySQL

2009-03-02 Thread Fortuno, Adam
Matya,

Ha, ha, ha! Thank you good friend. I did say I didn't try the code :-)

AF Please note, I haven't tried this. It just seems plausible.

I apologize if I confused anyone. I just meant to show how the parameter could 
help retrieve a picture. I wasn't too concerned with the particulars. Hopefully 
the concept is sound. If not, please do flame my note so no one attempts it.

Be Well,
A-

-Original Message-
From: Mattyasovszky Janos [mailto:m...@matya.hu] 
Sent: Monday, March 02, 2009 9:29 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Retrieving Image Location in MySQL

Fortuno, Adam írta:

   //Write a query to pull out the picture's path
   $sql = SELECT path FROM Image WHERE ID = %s;
   mysql_real_escape_string($value);

Sorry, but this won't work, since you don't map the value of the escaped 
$value to the %s, lets say with sprintf()...

Regards,
Matya

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


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



[PHP-DB] Help for a beginner

2009-12-23 Thread Adam Sonzogni
Hi everyone, first thank you for ALL help and the understanding that I am new 
to PHP and MySQL. This is a long email and for that I apologize but I am trying 
to provide as much detail as possible. If this is the wrong list to ask for 
help, kindly direct me to the proper authority.

I am trying to learn and I have built the following environment.

Windows Server 2008 Standard 32bit service Pack 2 with IIS7
mysql-essential-5.1.41-win32
php-5.3.1-nts-Win32-VC9-x86.msi
phpMyAdmin-3.2.4-english.zip


I followed the steps as detailed below (I already had IIS7 and CGI installed)


1. Install CGI  PHP
   http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/

2. Install MySQL
   http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/
   
3. Install PHPMyAdmin
   
http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/


After I completed the installations
1. If I navigate to the PHP directory and type php -info it spews a ton of data 
at me
   AND
   I created info.php which contains: ?php phpinfo(); ?
   When I browse this, it correctly produces a page with all the info about my 
PHP server. Although I do not understand much of it I believe this confirms PHP 
is working correctly with IIS

2. I open the MySQL CLI and perform the commands outlined in Step 23 at this 
page
   http://www.bicubica.com/apache-php-mysql/index.php
   This returns the expected results, confirming MySQL is working

3. PHP is configured to work with php_mysql.dll as per the steps in the 
trainsignal links above so I begin!
I go to the phpmyadmin page, enter root and my password and after a long time I 
get a FastCGI error. I am not ready to believe it because, in classic MS form, 
it has several VERY different potential causes, and I have covered all of 
those. Plus the error code is 0x which is like saying nothing... I 
start thinking maybe it is not connecting to the mYSQL server right, the 
instructions re: pma and the password made no sense to me so I fiddle with that 
with no change.


   I  write the mysql_test.php page in step 5 of 
http://www.bicubica.com/apache-php-mysql/index.php
   This fails with: A connection attempt failed because the connected party did 
not properly respond after a period of time, or established connection failed 
because connected host has failed to respond.

   Because the PHP failed I try with ASP...
   %
   set conn=Server.CreateObject(ADODB.Connection)
   conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
   conn.open
   Response.write(Connected)
   conn.close
   %

   This returns:
   Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
   [Microsoft][ODBC Driver Manager] Data source name not found and no 
default driver specified 
   /test.asp, line 4

I believe I have established MySQL is working, but for some reason it appears 
that it cannot be reached This IS on the same server so firewall should not 
be an issue, PLUS I confirmed the installer did create a hole. I turn off the 
MS firewall to be safe, no change I try a repair of MySQL, I uninstall, 
reboot and reinstall with no change.

NOTE: at several points I have tried iisreset and/or rebooting the system with 
no change.

I start to research the matter and my mind is now unglued. I found something 
referencing using mcrypt with PHPMyAdmin to speed it up and wondered if maybe 
the long delay before the FastCGI error could be resolved so I tracked down the 
dll, put it in my ext directory and changed my php.ini to reflect this -- file 
found at http://files.edin.dk/php/win32/mcrypt/

I found quite a bit about using libmysql.dll but there was no such file in my 
install, I pulled down the .zip package and that also did not contain it, I 
eventually found it in a 5.2.x archive but that does not seem to have helped. I 
have tried enabling: only mysql, mysql AND mysqli, and only mysqli. None of 
this seems to have done anything to change my situation.

Again, I apologize for the lengthy message, I hope I have accurately described 
my issue in the right amount of detail.

Thank You!
Adam Sonzogni




   

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



[PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
Mr. Brookhouse,

Thanks for the quick reply. I am guessing it is not relevant to my case because 
I am not using PERL. I cannot find anything that says PHP requires PERL so I 
suspect Iam ok in this regard.

Thank You,
Adam


-Original Message-
From: Edward Brookhouse [mailto:eb...@healthydirections.com] 
Sent: Wednesday, December 23, 2009 9:59 AM
To: Adam Sonzogni; php-db@lists.php.net
Subject: RE: Help for a beginner

Just a guess, as I have not tried a full stack in windows, but in any unix if 
you are connecting php and mysql, you need something in the middle like 
DBD::mysql

See if this helps: http://forums.mysql.com/read.php?51,189692,189856


-Original Message-
From: Adam Sonzogni [mailto:asonzo...@setfocus.com] 
Sent: Wednesday, December 23, 2009 9:52 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Help for a beginner

Hi everyone, first thank you for ALL help and the understanding that I am new 
to PHP and MySQL. This is a long email and for that I apologize but I am trying 
to provide as much detail as possible. If this is the wrong list to ask for 
help, kindly direct me to the proper authority.

I am trying to learn and I have built the following environment.

Windows Server 2008 Standard 32bit service Pack 2 with IIS7
mysql-essential-5.1.41-win32
php-5.3.1-nts-Win32-VC9-x86.msi
phpMyAdmin-3.2.4-english.zip


I followed the steps as detailed below (I already had IIS7 and CGI installed)


1. Install CGI  PHP
   http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/

2. Install MySQL
   http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/
   
3. Install PHPMyAdmin
   
http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/


After I completed the installations
1. If I navigate to the PHP directory and type php -info it spews a ton of data 
at me
   AND
   I created info.php which contains: ?php phpinfo(); ?
   When I browse this, it correctly produces a page with all the info about my 
PHP server. Although I do not understand much of it I believe this confirms PHP 
is working correctly with IIS

2. I open the MySQL CLI and perform the commands outlined in Step 23 at this 
page
   http://www.bicubica.com/apache-php-mysql/index.php
   This returns the expected results, confirming MySQL is working

3. PHP is configured to work with php_mysql.dll as per the steps in the 
trainsignal links above so I begin!
I go to the phpmyadmin page, enter root and my password and after a long time I 
get a FastCGI error. I am not ready to believe it because, in classic MS form, 
it has several VERY different potential causes, and I have covered all of 
those. Plus the error code is 0x which is like saying nothing... I 
start thinking maybe it is not connecting to the mYSQL server right, the 
instructions re: pma and the password made no sense to me so I fiddle with that 
with no change.


   I  write the mysql_test.php page in step 5 of 
http://www.bicubica.com/apache-php-mysql/index.php
   This fails with: A connection attempt failed because the connected party did 
not properly respond after a period of time, or established connection failed 
because connected host has failed to respond.

   Because the PHP failed I try with ASP...
   %
   set conn=Server.CreateObject(ADODB.Connection)
   conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
   conn.open
   Response.write(Connected)
   conn.close
   %

   This returns:
   Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
   [Microsoft][ODBC Driver Manager] Data source name not found and no 
default driver specified 
   /test.asp, line 4

I believe I have established MySQL is working, but for some reason it appears 
that it cannot be reached This IS on the same server so firewall should not 
be an issue, PLUS I confirmed the installer did create a hole. I turn off the 
MS firewall to be safe, no change I try a repair of MySQL, I uninstall, 
reboot and reinstall with no change.

NOTE: at several points I have tried iisreset and/or rebooting the system with 
no change.

I start to research the matter and my mind is now unglued. I found something 
referencing using mcrypt with PHPMyAdmin to speed it up and wondered if maybe 
the long delay before the FastCGI error could be resolved so I tracked down the 
dll, put it in my ext directory and changed my php.ini to reflect this -- file 
found at http://files.edin.dk/php/win32/mcrypt/

I found quite a bit about using libmysql.dll but there was no such file in my 
install, I pulled down the .zip package and that also did not contain it, I 
eventually found it in a 5.2.x archive but that does not seem to have helped. I 
have tried enabling: only mysql, mysql AND mysqli, and only mysqli. None of 
this seems to have done anything to change my situation.

Again, I apologize for the lengthy message, I hope I have accurately described 
my issue in the right amount

RE: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
Chaitanya,

Apache is not an option for us, and IIS is serving PHP without issue, so I 
would prefer to resolve my connectivity issue.

Thanks,
Adam

From: Chaitanya Yanamadala [mailto:dr.virus.in...@gmail.com]
Sent: Wednesday, December 23, 2009 10:17 AM
To: Adam Sonzogni
Cc: Edward Brookhouse; php-db@lists.php.net
Subject: Re: [PHP-DB] RE: Help for a beginner

why dont u install the xampp
On Wed, Dec 23, 2009 at 8:38 PM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.com wrote:
Mr. Brookhouse,

Thanks for the quick reply. I am guessing it is not relevant to my case because 
I am not using PERL. I cannot find anything that says PHP requires PERL so I 
suspect Iam ok in this regard.

Thank You,
Adam


-Original Message-
From: Edward Brookhouse 
[mailto:eb...@healthydirections.commailto:eb...@healthydirections.com]
Sent: Wednesday, December 23, 2009 9:59 AM
To: Adam Sonzogni; php-db@lists.php.netmailto:php-db@lists.php.net
Subject: RE: Help for a beginner

Just a guess, as I have not tried a full stack in windows, but in any unix if 
you are connecting php and mysql, you need something in the middle like 
DBD::mysql

See if this helps: http://forums.mysql.com/read.php?51,189692,189856


-Original Message-
From: Adam Sonzogni 
[mailto:asonzo...@setfocus.commailto:asonzo...@setfocus.com]
Sent: Wednesday, December 23, 2009 9:52 AM
To: php-db@lists.php.netmailto:php-db@lists.php.net
Subject: [PHP-DB] Help for a beginner

Hi everyone, first thank you for ALL help and the understanding that I am new 
to PHP and MySQL. This is a long email and for that I apologize but I am trying 
to provide as much detail as possible. If this is the wrong list to ask for 
help, kindly direct me to the proper authority.

I am trying to learn and I have built the following environment.

Windows Server 2008 Standard 32bit service Pack 2 with IIS7
mysql-essential-5.1.41-win32
php-5.3.1-nts-Win32-VC9-x86.msi
phpMyAdmin-3.2.4-english.zip


I followed the steps as detailed below (I already had IIS7 and CGI installed)


1. Install CGI  PHP
  http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/

2. Install MySQL
  http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/

3. Install PHPMyAdmin
  
http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/


After I completed the installations
1. If I navigate to the PHP directory and type php -info it spews a ton of data 
at me
  AND
  I created info.php which contains: ?php phpinfo(); ?
  When I browse this, it correctly produces a page with all the info about my 
PHP server. Although I do not understand much of it I believe this confirms PHP 
is working correctly with IIS

2. I open the MySQL CLI and perform the commands outlined in Step 23 at this 
page
  http://www.bicubica.com/apache-php-mysql/index.php
  This returns the expected results, confirming MySQL is working

3. PHP is configured to work with php_mysql.dll as per the steps in the 
trainsignal links above so I begin!
I go to the phpmyadmin page, enter root and my password and after a long time I 
get a FastCGI error. I am not ready to believe it because, in classic MS form, 
it has several VERY different potential causes, and I have covered all of 
those. Plus the error code is 0x which is like saying nothing... I 
start thinking maybe it is not connecting to the mYSQL server right, the 
instructions re: pma and the password made no sense to me so I fiddle with that 
with no change.


  I  write the mysql_test.php page in step 5 of 
http://www.bicubica.com/apache-php-mysql/index.php
  This fails with: A connection attempt failed because the connected party did 
not properly respond after a period of time, or established connection failed 
because connected host has failed to respond.

  Because the PHP failed I try with ASP...
  %
  set conn=Server.CreateObject(ADODB.Connection)
  conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
  conn.open
  Response.write(Connected)
  conn.close
  %

  This returns:
  Microsoft OLE DB Provider for ODBC Drivers error '80004005'
  [Microsoft][ODBC Driver Manager] Data source name not found and no 
default driver specified
  /test.asp, line 4

I believe I have established MySQL is working, but for some reason it appears 
that it cannot be reached This IS on the same server so firewall should not 
be an issue, PLUS I confirmed the installer did create a hole. I turn off the 
MS firewall to be safe, no change I try a repair of MySQL, I uninstall, 
reboot and reinstall with no change.

NOTE: at several points I have tried iisreset and/or rebooting the system with 
no change.

I start to research the matter and my mind is now unglued. I found something 
referencing using mcrypt with PHPMyAdmin to speed it up and wondered if maybe 
the long delay before the FastCGI error could be resolved so I tracked down the 
dll, put

RE: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
Giff,

Not sure what you mean, and I suspect this is because of my confusion around 
PMA (as mentioned originally) SO let me elaborate...



In my config.inc.php I changed pma to root and the pma password to the root 
password for mysql
When I browse to the phpmyadmin page I neter root and the root password for 
mysql

Thanks,
Adam

-Original Message-
From: Giff Hammar [mailto:gham...@sv-phoenix.com] 
Sent: Wednesday, December 23, 2009 10:41 AM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] RE: Help for a beginner

It looks like you are not connecting because of a user name/password
combination. Typically, Windows does not use root as a valid login as do
most other operating systems. Try using your login information to see if
you can connect to mySQL using the GUI. I suspect you'll succeed. The
other option would be to use the mySQL admin user name and password. One
of those should work.

Once you can connect to your database with the GUI, you can then use PHP
to call the mySQL database connect strings and manipulate your data as
necessary. The DBD/DBI is a more generic solution that allows you to use
a standard coding structure in PHP (or perl) and easily change databases
underneath. For a small implementation, this isn't necessary. There are
other database abstraction layers that perform the same function.

Giff

On Wed, 2009-12-23 at 20:46 +0530, Chaitanya Yanamadala wrote:
 why dont u install the xampp
 
 On Wed, Dec 23, 2009 at 8:38 PM, Adam Sonzogni asonzo...@setfocus.comwrote:
 
  Mr. Brookhouse,
 
  Thanks for the quick reply. I am guessing it is not relevant to my case
  because I am not using PERL. I cannot find anything that says PHP requires
  PERL so I suspect Iam ok in this regard.
 
  Thank You,
  Adam
 
 
  -Original Message-
  From: Edward Brookhouse [mailto:eb...@healthydirections.com]
  Sent: Wednesday, December 23, 2009 9:59 AM
  To: Adam Sonzogni; php-db@lists.php.net
  Subject: RE: Help for a beginner
 
  Just a guess, as I have not tried a full stack in windows, but in any unix
  if you are connecting php and mysql, you need something in the middle like
  DBD::mysql
 
  See if this helps: http://forums.mysql.com/read.php?51,189692,189856
 
 
  -Original Message-
  From: Adam Sonzogni [mailto:asonzo...@setfocus.com]
  Sent: Wednesday, December 23, 2009 9:52 AM
  To: php-db@lists.php.net
  Subject: [PHP-DB] Help for a beginner
 
  Hi everyone, first thank you for ALL help and the understanding that I am
  new to PHP and MySQL. This is a long email and for that I apologize but I am
  trying to provide as much detail as possible. If this is the wrong list to
  ask for help, kindly direct me to the proper authority.
 
  I am trying to learn and I have built the following environment.
 
  Windows Server 2008 Standard 32bit service Pack 2 with IIS7
  mysql-essential-5.1.41-win32
  php-5.3.1-nts-Win32-VC9-x86.msi
  phpMyAdmin-3.2.4-english.zip
 
 
  I followed the steps as detailed below (I already had IIS7 and CGI
  installed)
 
 
  1. Install CGI  PHP
http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/
 
  2. Install MySQL
http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/
 
  3. Install PHPMyAdmin
 
  http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/
 
 
  After I completed the installations
  1. If I navigate to the PHP directory and type php -info it spews a ton of
  data at me
AND
I created info.php which contains: ?php phpinfo(); ?
When I browse this, it correctly produces a page with all the info about
  my PHP server. Although I do not understand much of it I believe this
  confirms PHP is working correctly with IIS
 
  2. I open the MySQL CLI and perform the commands outlined in Step 23 at
  this page
http://www.bicubica.com/apache-php-mysql/index.php
This returns the expected results, confirming MySQL is working
 
  3. PHP is configured to work with php_mysql.dll as per the steps in the
  trainsignal links above so I begin!
  I go to the phpmyadmin page, enter root and my password and after a long
  time I get a FastCGI error. I am not ready to believe it because, in classic
  MS form, it has several VERY different potential causes, and I have covered
  all of those. Plus the error code is 0x which is like saying
  nothing... I start thinking maybe it is not connecting to the mYSQL server
  right, the instructions re: pma and the password made no sense to me so I
  fiddle with that with no change.
 
 
I  write the mysql_test.php page in step 5 of
  http://www.bicubica.com/apache-php-mysql/index.php
This fails with: A connection attempt failed because the connected party
  did not properly respond after a period of time, or established connection
  failed because connected host has failed to respond.
 
Because the PHP failed I try with ASP...
%
set conn=Server.CreateObject(ADODB.Connection)
conn.ConnectionString

RE: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
Barry,

Yes this is all installed ona single system.

The code was in the original message

   %
   set conn=Server.CreateObject(ADODB.Connection)
   conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
   conn.open
   Response.write(Connected)
   conn.close
   %



So line 4 is:   conn.open


Thanks,
Adam

-Original Message-
From: Barry Stear [mailto:bst...@gmail.com] 
Sent: Wednesday, December 23, 2009 11:28 AM
To: PHP DB Posts
Subject: Re: [PHP-DB] RE: Help for a beginner

Adam,

What is at Line 4 in your test.asp? The error you provided said that there
was a problem where it could not find the default driver to use.

Also when you get the connection failed you were trying to connect to MYSQL
from the system running MYSQL correct?

On Wed, Dec 23, 2009 at 7:50 AM, Adam Sonzogni asonzo...@setfocus.comwrote:

 Giff,

 Not sure what you mean, and I suspect this is because of my confusion
 around PMA (as mentioned originally) SO let me elaborate...



 In my config.inc.php I changed pma to root and the pma password to the root
 password for mysql
 When I browse to the phpmyadmin page I neter root and the root password for
 mysql

 Thanks,
 Adam

 -Original Message-
 From: Giff Hammar [mailto:gham...@sv-phoenix.com]
 Sent: Wednesday, December 23, 2009 10:41 AM
 To: php-db@lists.php.net
  Subject: Re: [PHP-DB] RE: Help for a beginner

 It looks like you are not connecting because of a user name/password
 combination. Typically, Windows does not use root as a valid login as do
 most other operating systems. Try using your login information to see if
 you can connect to mySQL using the GUI. I suspect you'll succeed. The
 other option would be to use the mySQL admin user name and password. One
 of those should work.

 Once you can connect to your database with the GUI, you can then use PHP
 to call the mySQL database connect strings and manipulate your data as
 necessary. The DBD/DBI is a more generic solution that allows you to use
 a standard coding structure in PHP (or perl) and easily change databases
 underneath. For a small implementation, this isn't necessary. There are
 other database abstraction layers that perform the same function.

 Giff

 On Wed, 2009-12-23 at 20:46 +0530, Chaitanya Yanamadala wrote:
  why dont u install the xampp
 
  On Wed, Dec 23, 2009 at 8:38 PM, Adam Sonzogni asonzo...@setfocus.com
 wrote:
 
   Mr. Brookhouse,
  
   Thanks for the quick reply. I am guessing it is not relevant to my case
   because I am not using PERL. I cannot find anything that says PHP
 requires
   PERL so I suspect Iam ok in this regard.
  
   Thank You,
   Adam
  
  
   -Original Message-
   From: Edward Brookhouse [mailto:eb...@healthydirections.com]
   Sent: Wednesday, December 23, 2009 9:59 AM
   To: Adam Sonzogni; php-db@lists.php.net
   Subject: RE: Help for a beginner
  
   Just a guess, as I have not tried a full stack in windows, but in any
 unix
   if you are connecting php and mysql, you need something in the middle
 like
   DBD::mysql
  
   See if this helps: http://forums.mysql.com/read.php?51,189692,189856
  
  
   -Original Message-
   From: Adam Sonzogni [mailto:asonzo...@setfocus.com]
   Sent: Wednesday, December 23, 2009 9:52 AM
   To: php-db@lists.php.net
   Subject: [PHP-DB] Help for a beginner
  
   Hi everyone, first thank you for ALL help and the understanding that I
 am
   new to PHP and MySQL. This is a long email and for that I apologize but
 I am
   trying to provide as much detail as possible. If this is the wrong list
 to
   ask for help, kindly direct me to the proper authority.
  
   I am trying to learn and I have built the following environment.
  
   Windows Server 2008 Standard 32bit service Pack 2 with IIS7
   mysql-essential-5.1.41-win32
   php-5.3.1-nts-Win32-VC9-x86.msi
   phpMyAdmin-3.2.4-english.zip
  
  
   I followed the steps as detailed below (I already had IIS7 and CGI
   installed)
  
  
   1. Install CGI  PHP
  
 http://www.trainsignaltraining.com/iis-7-install-fastcgi-php/2008-09-04/
  
   2. Install MySQL
 http://www.trainsignaltraining.com/install-mysql-on-iis7/2008-09-10/
  
   3. Install PHPMyAdmin
  
  
 http://www.trainsignaltraining.com/install-phpmyadmin-on-iis7-and-server-2008/2008-09-16/
  
  
   After I completed the installations
   1. If I navigate to the PHP directory and type php -info it spews a ton
 of
   data at me
 AND
 I created info.php which contains: ?php phpinfo(); ?
 When I browse this, it correctly produces a page with all the info
 about
   my PHP server. Although I do not understand much of it I believe this
   confirms PHP is working correctly with IIS
  
   2. I open the MySQL CLI and perform the commands outlined in Step 23 at
   this page
 http://www.bicubica.com/apache-php-mysql/index.php
 This returns the expected results, confirming MySQL is working
  
   3. PHP is configured to work with php_mysql.dll as per

RE: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
If you read the thread I useda php page totest mysql connectivity after 
phpmyadmin did not work...

At this point I am willing to pay someone to troubleshoot this as I am baffled 
there is no definitive troubleshooting documentation for Windows installs.


From: Barry Stear [mailto:bst...@gmail.com]
Sent: Wednesday, December 23, 2009 12:04 PM
To: Adam Sonzogni
Cc: PHP DB Posts
Subject: Re: [PHP-DB] RE: Help for a beginner

Well I am not familiar with ASP.  You might want to check to make sure that you 
didn't make any typos in your mysql_test.php page. I would suggest seeing if 
you can connect through phpMyAdmin. That might give you a better idea of where 
the problem lies.

On Wed, Dec 23, 2009 at 8:31 AM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.com wrote:
Barry,

Yes this is all installed ona single system.

The code was in the original message

  %
  set conn=Server.CreateObject(ADODB.Connection)
  conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
  conn.open
  Response.write(Connected)
  conn.close
  %


So line 4 is:   conn.open


Thanks,
Adam

-Original Message-
From: Barry Stear [mailto:bst...@gmail.commailto:bst...@gmail.com]
Sent: Wednesday, December 23, 2009 11:28 AM
To: PHP DB Posts
Subject: Re: [PHP-DB] RE: Help for a beginner

Adam,

What is at Line 4 in your test.asp? The error you provided said that there
was a problem where it could not find the default driver to use.

Also when you get the connection failed you were trying to connect to MYSQL
from the system running MYSQL correct?

On Wed, Dec 23, 2009 at 7:50 AM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.comwrote:

 Giff,

 Not sure what you mean, and I suspect this is because of my confusion
 around PMA (as mentioned originally) SO let me elaborate...



 In my config.inc.php I changed pma to root and the pma password to the root
 password for mysql
 When I browse to the phpmyadmin page I neter root and the root password for
 mysql

 Thanks,
 Adam

 -Original Message-
 From: Giff Hammar 
 [mailto:gham...@sv-phoenix.commailto:gham...@sv-phoenix.com]
 Sent: Wednesday, December 23, 2009 10:41 AM
 To: php-db@lists.php.netmailto:php-db@lists.php.net
  Subject: Re: [PHP-DB] RE: Help for a beginner

 It looks like you are not connecting because of a user name/password
 combination. Typically, Windows does not use root as a valid login as do
 most other operating systems. Try using your login information to see if
 you can connect to mySQL using the GUI. I suspect you'll succeed. The
 other option would be to use the mySQL admin user name and password. One
 of those should work.

 Once you can connect to your database with the GUI, you can then use PHP
 to call the mySQL database connect strings and manipulate your data as
 necessary. The DBD/DBI is a more generic solution that allows you to use
 a standard coding structure in PHP (or perl) and easily change databases
 underneath. For a small implementation, this isn't necessary. There are
 other database abstraction layers that perform the same function.

 Giff

 On Wed, 2009-12-23 at 20:46 +0530, Chaitanya Yanamadala wrote:
  why dont u install the xampp
 
  On Wed, Dec 23, 2009 at 8:38 PM, Adam Sonzogni 
  asonzo...@setfocus.commailto:asonzo...@setfocus.com
 wrote:
 
   Mr. Brookhouse,
  
   Thanks for the quick reply. I am guessing it is not relevant to my case
   because I am not using PERL. I cannot find anything that says PHP
 requires
   PERL so I suspect Iam ok in this regard.
  
   Thank You,
   Adam
  
  
   -Original Message-
   From: Edward Brookhouse 
   [mailto:eb...@healthydirections.commailto:eb...@healthydirections.com]
   Sent: Wednesday, December 23, 2009 9:59 AM
   To: Adam Sonzogni; php-db@lists.php.netmailto:php-db@lists.php.net
   Subject: RE: Help for a beginner
  
   Just a guess, as I have not tried a full stack in windows, but in any
 unix
   if you are connecting php and mysql, you need something in the middle
 like
   DBD::mysql
  
   See if this helps: http://forums.mysql.com/read.php?51,189692,189856
  
  
   -Original Message-
   From: Adam Sonzogni 
   [mailto:asonzo...@setfocus.commailto:asonzo...@setfocus.com]
   Sent: Wednesday, December 23, 2009 9:52 AM
   To: php-db@lists.php.netmailto:php-db@lists.php.net
   Subject: [PHP-DB] Help for a beginner
  
   Hi everyone, first thank you for ALL help and the understanding that I
 am
   new to PHP and MySQL. This is a long email and for that I apologize but
 I am
   trying to provide as much detail as possible. If this is the wrong list
 to
   ask for help, kindly direct me to the proper authority.
  
   I am trying to learn and I have built the following environment.
  
   Windows Server 2008 Standard 32bit service Pack 2 with IIS7
   mysql-essential-5.1.41-win32
   php-5.3.1-nts-Win32-VC9-x86.msi
   phpMyAdmin-3.2.4-english.zip
  
  
   I followed the steps as detailed below (I

RE: [PHP-DB] RE: Help for a beginner

2009-12-23 Thread Adam Sonzogni
Barry,

You sir saved the day, the very last item on that page was the ticket, I 
disabled IPV6 but never thought to removed the localhost entry for ipv6 in 
hosts...

That said I google'd dozens of times with a variety of keyword combinations all 
including iis7 and PHP,  and not once did that page pop up :(



The default installation of Windows Vista, Windows 7 and Windows Server 2008 
adds a line to the Windows/System32/drivers/etc/hosts which causes network 
functions (database connect functions too, like mysql_connect) to timeout when 
connecting to localhost.  To resolve this problem, remove the entry from the 
hosts file:
::1 localhost

or connect using the IP address, 127.0.0.1 or another domain name.

This behavior change is due to IPv6 being enabled by default in Vista or other 
recent Windows version.




From: Barry Stear [mailto:bst...@gmail.com]
Sent: Wednesday, December 23, 2009 1:54 PM
To: Adam Sonzogni; PHP DB Posts
Subject: Re: [PHP-DB] RE: Help for a beginner

I apologize I do see that you tried using phpmyadmin and received the FastCGI 
error.

This might help you : http://www.php.net/manual/en/install.windows.iis7.php   . 
Let me know what happens after you try those steps.. I am hoping for the best..


On Wed, Dec 23, 2009 at 9:21 AM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.com wrote:
If you read the thread I useda php page totest mysql connectivity after 
phpmyadmin did not work...

At this point I am willing to pay someone to troubleshoot this as I am baffled 
there is no definitive troubleshooting documentation for Windows installs.


From: Barry Stear [mailto:bst...@gmail.commailto:bst...@gmail.com]
Sent: Wednesday, December 23, 2009 12:04 PM
To: Adam Sonzogni
Cc: PHP DB Posts

Subject: Re: [PHP-DB] RE: Help for a beginner

Well I am not familiar with ASP.  You might want to check to make sure that you 
didn't make any typos in your mysql_test.php page. I would suggest seeing if 
you can connect through phpMyAdmin. That might give you a better idea of where 
the problem lies.
On Wed, Dec 23, 2009 at 8:31 AM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.com wrote:
Barry,

Yes this is all installed ona single system.

The code was in the original message

  %
  set conn=Server.CreateObject(ADODB.Connection)
  conn.ConnectionString=Driver={mySQL};Server=localhost;Database=test;User 
Id=root;Password=youwish
  conn.open
  Response.write(Connected)
  conn.close
  %

So line 4 is:   conn.open


Thanks,
Adam

-Original Message-
From: Barry Stear [mailto:bst...@gmail.commailto:bst...@gmail.com]
Sent: Wednesday, December 23, 2009 11:28 AM
To: PHP DB Posts
Subject: Re: [PHP-DB] RE: Help for a beginner

Adam,

What is at Line 4 in your test.asp? The error you provided said that there
was a problem where it could not find the default driver to use.

Also when you get the connection failed you were trying to connect to MYSQL
from the system running MYSQL correct?

On Wed, Dec 23, 2009 at 7:50 AM, Adam Sonzogni 
asonzo...@setfocus.commailto:asonzo...@setfocus.comwrote:

 Giff,

 Not sure what you mean, and I suspect this is because of my confusion
 around PMA (as mentioned originally) SO let me elaborate...



 In my config.inc.php I changed pma to root and the pma password to the root
 password for mysql
 When I browse to the phpmyadmin page I neter root and the root password for
 mysql

 Thanks,
 Adam

 -Original Message-
 From: Giff Hammar 
 [mailto:gham...@sv-phoenix.commailto:gham...@sv-phoenix.com]
 Sent: Wednesday, December 23, 2009 10:41 AM
 To: php-db@lists.php.netmailto:php-db@lists.php.net
  Subject: Re: [PHP-DB] RE: Help for a beginner

 It looks like you are not connecting because of a user name/password
 combination. Typically, Windows does not use root as a valid login as do
 most other operating systems. Try using your login information to see if
 you can connect to mySQL using the GUI. I suspect you'll succeed. The
 other option would be to use the mySQL admin user name and password. One
 of those should work.

 Once you can connect to your database with the GUI, you can then use PHP
 to call the mySQL database connect strings and manipulate your data as
 necessary. The DBD/DBI is a more generic solution that allows you to use
 a standard coding structure in PHP (or perl) and easily change databases
 underneath. For a small implementation, this isn't necessary. There are
 other database abstraction layers that perform the same function.

 Giff

 On Wed, 2009-12-23 at 20:46 +0530, Chaitanya Yanamadala wrote:
  why dont u install the xampp
 
  On Wed, Dec 23, 2009 at 8:38 PM, Adam Sonzogni 
  asonzo...@setfocus.commailto:asonzo...@setfocus.com
 wrote:
 
   Mr. Brookhouse,
  
   Thanks for the quick reply. I am guessing it is not relevant to my case
   because I am not using PERL. I cannot find anything that says PHP
 requires
   PERL so I suspect Iam ok in this regard.
  
   Thank You,
   Adam

RE: [PHP-DB] File Downloads

2010-05-28 Thread Adam Schroeder
Hi Karl --

You can store the file contents outside of the web tree and use PHP to read 
the contents.  This allows you to place access control restrictions in the PHP 
script.

This post talks about doing something similar with images.  Obviously, if you 
have a music track... you'll need to adjust the mime type accordingly.

http://stackoverflow.com/questions/258365/php-link-to-image-file-outside-default-web-directory/258380#258380

Good luck.

Adam


-Original Message-
From: Karl DeSaulniers [mailto:k...@designdrumm.com] 
Sent: Friday, May 28, 2010 1:39 PM
To: php-db@lists.php.net
Subject: [PHP-DB] File Downloads

Hello,
How can I go about restricting the number of downloads of a file on  
my server?
For Eg: if I want a music track to only be able to be downloaded by  
150 people and thats it.. ever,
how can I go about doing this?

Much obliged,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



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



RE: [PHP-DB] File Downloads

2010-05-28 Thread Adam Schroeder
Hi Karl --

It depends -- you could track the download logs in a database and limit based 
on IP.

So your steps would be:

1) User visits PHP script

2) If the user has not downloaded the file before and if the number of 
downloads is less than 150 then allow them to download.

3) PHP script grabs user's IP address from $_SERVER['REMOTE_ADDR'].

4) When the script's copy function completes, register the user's IP address in 
a database.  You can later check against this to verify they have not 
downloaded the file.

Using IP addresses for this type of control come with problems... but depending 
on the importance of the content -- it should be good.

Adam
 

-Original Message-
From: Karl DeSaulniers [mailto:k...@designdrumm.com] 
Sent: Friday, May 28, 2010 2:36 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] File Downloads


On May 28, 2010, at 4:33 PM, Karl DeSaulniers wrote:


 On May 28, 2010, at 4:18 PM, Adam Schroeder wrote:

 Hi Karl --

 You can store the file contents outside of the web tree and use  
 PHP to read the contents.  This allows you to place access  
 control restrictions in the PHP script.

 This post talks about doing something similar with images.   
 Obviously, if you have a music track... you'll need to adjust the  
 mime type accordingly.

 http://stackoverflow.com/questions/258365/php-link-to-image-file- 
 outside-default-web-directory/258380#258380

 Good luck.

 Adam


 -Original Message-
 From: Karl DeSaulniers [mailto:k...@designdrumm.com]
 Sent: Friday, May 28, 2010 1:39 PM
 To: php-db@lists.php.net
 Subject: [PHP-DB] File Downloads

 Hello,
 How can I go about restricting the number of downloads of a file on
 my server?
 For Eg: if I want a music track to only be able to be downloaded by
 150 people and thats it.. ever,
 how can I go about doing this?

 Much obliged,

 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com



 Very Nice. Good link.
 I think this is the route I may go.
 Seems a bit more secure if the php script gains access to the file  
 through the .htaccess files set-up.

 Thanks Adam.

 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com


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


But how do I tetect if a file has been downloaded by multiple people  
and in the process stop someone who has downloaded it once to not be  
able to do again?
THX

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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


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



Re: [PHP-DB] Optimal mySQL query for next prev page system

2003-11-18 Thread Adam i Agnieszka Gasiorowski FNORD
Kim Steinhaug wrote:

 Then I query the mySQL database again to get the final result set, which
 I return together
 with the buildt prev/next htmlkode

Instead of querying twice, use the
 SQL_CALC_FOUND_ROWS parameter of SELECT
 statement and then do a quick

 SELECT HIGH_PRIORITY FOUND_ROWS();

, to get the number of found rows
 (full number, ignoring LIMIT clause).

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



[PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread Adam i Agnieszka Gasiorowski FNORD

I cannot use this query

CREATE TABLE table LIKE other_table;

, which is supposed to create an
 empty clone of the other_table named
 table.
Was it added in some later MySQL version?
 It's in the manual on mysql.com, bo no version info
 available.

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



Re: [PHP-DB] CREATE TABLE LIKE, error

2003-12-15 Thread Adam i Agnieszka Gasiorowski FNORD
CPT John W. Holmes wrote:
 
 From: Adam i Agnieszka Gasiorowski FNORD [EMAIL PROTECTED]
 
  I cannot use this query
 
  CREATE TABLE table LIKE other_table;
 
  , which is supposed to create an
   empty clone of the other_table named
   table.
  Was it added in some later MySQL version?
   It's in the manual on mysql.com, bo no version info
   available.
 
 Sure there is, you just had to keep reading.
 
 Quote:
 In MySQL 4.1, you can also use LIKE to create a table based on the
 definition of another table, including any column attributes and indexes the
 original table has:

Ah, I missed it. Do you know what is
 an estimate for 4.1 to go stable?
 
 CREATE TABLE new_tbl LIKE orig_tbl;
 CREATE TABLE ... LIKE does not copy any DATA DIRECTORY or INDEX DIRECTORY
 table options that were specified for the original table.
 
 Since this is a PHP list, an alternative, two-step method is to issue a SHOW
 CREATE TABLE Table_Name query, retrieve the results, and use them to create
 your second table (replacing the table name, of course).

Thank you very much.

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

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



Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-02 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote:
 
 If you are concerned with speed, consider multiple queries.  Joins cause
 most delays.  Give that a shot.

What do you mean? Sorry, please explain
 futher, I don't know what you have in mind...
 I have to do some of those joins, because of
 the relationships between tables - I don't
 want to count invisible articles, so I have
 to JOIN on x_instance table to get to know
 if they are visible at all in any of the
 subsections in the section tree. How would
 you solve this dilemma? Thank you for your
 time.
 
 (sorry if my English is sometimes hard to understand)

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

smime.p7s
Description: S/MIME Cryptographic Signature


Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-02 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote:
 
 Could you repost your original message (I deleted it already, sorry.)  and
 more details about your database tables even some sample data.  I'll try to
 make more sense of the query you are performing and help you along.
 
 In general it would be better to eliminate the joins.  But there are other
 reasons to use the joins as you are doing, it just depends.  Sometimes
 doing your distinct first then processing that data in an array will be
 faster.  That is as long as you don't have a million records it needs to
 process.
 
 I'll see what I can do,

To put it short, this just takes to long
 to process. I need to make it faster. Relevant
 fragment below. What I want is a sum of all
 new, instantiated (visible) articles in all non 
 hidden sections, where new is defined as
 today, from 00:00:01 to 23:59:59. As you can
 see I count in departments 2 and 5, because
 other would give false results(the 3 department
 shares a lot of articles with the 2 department
 and if there is an article in the 3 department
 it is always in 2 too). First I need to know 
 if the article is instantiated, so I JOIN with
 x_instance. From the x_instance table I get also
 the state of the article. Then I need to know the 
 department plus is the section I am querying visible at
 all (some aren't), so I JOIN on x_section. Then
 I add all the counts over all the sections and 
 pretty-print a sum. If you need some diagnostic
 information, please tell me what you need (results
 of EXPLAIN? SHOW?). IIRC, all the fields I JOIN on
 are indexed (BTREE).

 ?
 $suma = 0;
 $pytanie  = SELECT COUNT(DISTINCT x_article.ID) AS CNT ;
 $pytanie .= FROM x_article ;
 $pytanie .= LEFT JOIN x_instance ;
 $pytanie .= ON x_article.ID = x_instance.Article ;
 $pytanie .= LEFT JOIN x_section ;
 $pytanie .= ON x_instance.Section = x_section.ID ;
 $pytanie .= WHERE (x_section.Status  1) = 0 ; // not empty
 $pytanie .= AND (x_section.Dept = 2 OR x_section.Dept = 5) ; // Drugs, NeuroGroove
 $pytanie .= AND (x_instance.Status  255) = 0 ; // not hidden, etc
 $pytanie .= AND UNIX_TIMESTAMP(x_article.Date) BETWEEN  . mktime(0, 0, 1, 
 date('m'), date('d'), date('Y')) .  AND UNIX_TIMESTAMP(NOW()) ;
 $pytanie .= GROUP BY x_article.ID;
 $wynik = mysql_query($pytanie);
 while ($tmp = mysql_fetch_array($wynik))
 {
   $suma += $tmp['CNT'];
 }
 if ($suma) 
 {
   // pretty-printing of the result
   $dzisdodano = str_pad((string)(int)$suma, 4, '0', STR_PAD_LEFT);
 }
 else $dzisdodano = '';
 ?
 
 The table layout is as follows:
 
 mysql DESC x_article;
 +-+--+--+-+--++
 | Field   | Type | Null | Key | Default  | Extra 
  |
 +-+--+--+-+--++
 | ID  | int(10) unsigned |  | PRI | NULL | 
 auto_increment |
 | Name| varchar(255) | YES  | MUL | NULL |   
  |
 | Description | varchar(255) | YES  | | NULL |   
  |
 | Keywords| varchar(255) | YES  | | NULL |   
  |
 | Content | mediumtext   |  | |  |   
  |
 | Date| datetime |  | | 2001-01-01 00:00:00  |   
  |
 | Author  | varchar(100) |  | | [EMAIL PROTECTED] ||
 | Feedback| varchar(100) | YES  | | NULL |   
  |
 | Size| int(32)  | YES  | | NULL |   
  |
 | Words   | int(32)  | YES  | | NULL |   
  |
 | Images  | int(32)  | YES  | | NULL |   
  |
 +-+--+--+-+--++
 
 mysql DESC x_instance;
 +--+--+--+-+-+---+
 | Field| Type | Null | Key | Default | Extra |
 +--+--+--+-+-+---+
 | Article  | mediumint(9) |  | MUL | 0   |   |
 | Section  | mediumint(9) |  | MUL | 0   |   |
 | Priority | tinyint(4)   |  | | 0   |   |
 | Status   | int(16) unsigned |  | | 0   |   |
 +--+--+--+-+-+---+
 
 mysql DESC x_section;
 +--+--+--+-+---++
 | Field| Type | Null | Key | Default   | Extra  |
 +--+--+--+-+---++
 | ID   | mediumint(9) |  | PRI | NULL  | auto_increment |
 | Name | varchar(100) |  | MUL |   ||
 | Parent   | mediumint(9) |  | MUL | 0 ||
 | Dept   

Re: [PHP-DB] Trouble With Counting New Documents With Complex Query

2004-01-04 Thread Adam i Agnieszka Gasiorowski FNORD
Jeremy Peterson wrote:
 
 I haven't tested this code, but it should get you started.  I imagine that
 you have a lot of different days that you are trying to restrict in your
 query (This could be costing you a lot of time), so the first query removes
 all articles you don't want up front before doing your joins.  If you were
 using a database that allows subselects, you could have shortened this even
 more (Last I heard MYSQL doesn't support subselects).  Ultimatly you
 shorten the time the query executes because you are removing unnecessary
 computation with the joins.
 
 I hope this helps you along your way.

Thank you, I'll try to make something out of it
 and test it :8] Maybe I will even get an idea or two
 to improve it futher...

-- 
Seks, seksi, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne ksztaty... http://www.opera.com 007

smime.p7s
Description: S/MIME Cryptographic Signature


[PHP-DB] [Fwd: Catalog listing]

2004-01-04 Thread Adam i Agnieszka Gasiorowski FNORD

LOL, look what I've got after posting
 to one of the groups about my problem with
 multiple JOIN query...Some kind of robot
 reads one of them?

 Original Message 
From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Precedence: bulk
Subject: Catalog listing
To: [EMAIL PROTECTED]

Catalog PAGE OF THE BOOK IS VISIBLE IN THE SECTION does not exist.

smime.p7s
Description: S/MIME Cryptographic Signature


<    1   2   3