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 .
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
), 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. I add a column in Employee that holds the primary key
of the employee's associated department. 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!
> 
>  // Server in the this format:
> \ or 
> // , 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:



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 

> 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
>
>  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
>
>  echo "";
> ?>
>
> 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] Re: session variable in select query showing picture from database

2009-02-12 Thread Fortuno, Adam
Mika,

Echo out the dynamically created SQL statement ie., $query = "SELECT *
FROM MyTable WHERE ID = ${ID}"; ECHO $query;" Let us see what is
actually being passed.

P.S. I couldn't agree more with the poster that said, don't pass user
input directly to a SQL statement.

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

*Answer to Rick:

in your code below it looks like you're simply hard-coding your
"$band_id" value (as "11") -- so of course it's going to work.

*Yes, I did that because one of you helpers asked me to try that.

I'll try to be clearer on whom I'm answering to...

--
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).



Sashi's Test Page


", $row['firstname']);
}

//Clean up
mysql_free_result($output);

?>



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 / /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: 
   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: 
   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 messag

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 
mailto: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<mailto:eb...@healthydirections.com>]
Sent: Wednesday, December 23, 2009 9:59 AM
To: Adam Sonzogni; php-db@lists.php.net<mailto: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<mailto:asonzo...@setfocus.com>]
Sent: Wednesday, December 23, 2009 9:52 AM
To: php-db@lists.php.net<mailto: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: 
  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 del

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 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: 
> >   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 sta

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 wrote:

> 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  >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/ins

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 
mailto: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.com<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 
mailto:asonzo...@setfocus.com>>wrote:

> 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<mailto:gham...@sv-phoenix.com>]
> Sent: Wednesday, December 23, 2009 10:41 AM
> To: php-db@lists.php.net<mailto: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 
> > mailto: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<mailto:eb...@healthydirections.com>]
> > > Sent: Wednesday, December 23, 2009 9:59 AM
> > > To: Adam Sonzogni; php-db@lists.php.net<mailto: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<mailto:asonzo...@setfocus.com>]
> > > Sent: Wednesday, December 23, 2009 9:52 AM
> > > To: php-db@lists.php.net<mailto:php-db@lists.php

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 
mailto: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.com<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 
mailto: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.com<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 
mailto:asonzo...@setfocus.com>>wrote:

> 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<mailto:gham...@sv-phoenix.com>]
> Sent: Wednesday, December 23, 2009 10:41 AM
> To: php-db@lists.php.net<mailto: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 
> > mailto:asonzo...@setfocus.com>
> >wrote:
>

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] Returning a formated dat

2001-02-02 Thread Adam Younce

Ben,

The easiest (and quickest) way I've done this in the past is to use
MySQL's DATE_FORMAT function when doing the SELECT. To format it like you
want try this:

SELECT DATE_FORMAT(date_column, '%m/%d/%y') as f_date FROM Table_name;

Be sure to use the correct name for the column that the date is stored
in.

To get more info on the DATE_FORMAT function, check out the MySQL online
manual.

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Dat
e_and_time_functions

Regards,

Adam Younce
[EMAIL PROTECTED]

- Original Message -
From: "Ben Cairns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 4:13 AM
Subject: [PHP-DB] Returning a formated dat


> I have a date stored in a MySQL field in a format like this:
>
> For example, 02/02/2001 (Today) would be stored as:
> 02022001
>
> What I need to do is to format that so that it looks like:
> 02/02/2001
>
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
>
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK.."
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Is MySQL in 4.0.6?

2001-06-25 Thread Adam Lundrigan

Is MySQL included in the 406kb version of PHP 4.0.6?
When I try to connect to MySQL (after adding localhost & paswords to php.ini) using 
this version it says:
Warning: Can't connect to MySQL server on 'localhost' (10061) in mysql_local_test.php 
on line 2

>From what i've heard, MySQL is included in PHPbut why doesn't the connect work if 
>it is included?

-Adam Lundrigan
 CEO, VPU
 http://www.vpu-virtual.com/
 
 ICQ # 73617446
 [EMAIL PROTECTED]

 



[PHP-DB] PHP on Linux and MS SQL

2001-07-30 Thread Adam Oliver

Anybody know of a good installation description for connection PHP on linux
to MS SQL on a 2000 machine?  I've been through about 3 so far and none of
them have worked.

Adam



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Can't connect to MS SQL

2001-07-30 Thread Adam Oliver

I have PHP running on Apache for win32.  The mssql module is enabled.  I am
trying to connect to a database with the following code.



However I get the following error.

Warning: MS SQL: Unable to connect to server: 192.168.1.1:1433 in c:\program
files\apache group\apache\htdocs\meyedev\connect.php4 on line 11
DATABASE FAILED TO RESPOND.

What am I doing wrong?

Adam



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Random question selection in PHP w/ MySQL backend.

2001-07-31 Thread Adam Lundrigan

I'm having a bit of trouble creating a random question selector. I'm using PHP 4.0.6 
and MySQL 3.23.36 on Windows 98 SE.
I've tried several different solutions, but none work at all.

What i need to do is select 10 questions from a database (db: vpt, table: questions), 
and make sure that the same question doesn't appear twice. The questions need to 
appear in a random order each time the script is loaded. It sounds simple enough, but 
i just can't seem to get it to work.

Any suggestions??


Thanks in advance,
 
-Adam Lundrigan
 CEO, VPU
 http://www.vpu-virtual.com/
 
 ICQ # 73617446
 [EMAIL PROTECTED]

 



[PHP-DB] REG_EMPTY

2001-08-01 Thread Adam Lundrigan

What exactly does the error 'REG_EMPTY' mean in PHP?

-- 
-Adam Lundrigan
 CEO, VPU
 http://www.vpu-virtual.com/
 
 ICQ # 73617446
 [EMAIL PROTECTED]

 



[PHP-DB] MySQL Connection Lost....

2001-08-13 Thread Adam Douglas

Ok I've finally gotten MySQL 3.23.37 installed and operating. Thanks to 
all that helped! The problem I'm now experiencing is when I try to 
interface with MySQL via PHP. MySQL seems to work fine by logging into 
MySQL directly and through a MySQL GUI Client. I get the following error...

Warning: MySQL Connection Failed: Lost connection to MySQL server during 
query...

I'm assuming this is a MySQL issue since everything worked fine before 
the upgrade from MySQL 3.32.22 to MySQL 3.23.37. But for all I know it 
could be PHP I guess.

I'm doing very simple query to see if it works and no success. Even code 
that worked before I upgraded doesn't work anymore. Here's the test 
query I made... (BTW, the below query works fine via MySQL/MySQL GUI Client)

$szQuery = "SELECT * FROM People WHERE First_Name='adouglas'";
$dbconnection = mysql_connect("207.195.58.33","webuser","adamacc226");
mysql_select_db("venmar", $dbConnection) or die("could not connect to 
venmar for security authentication.");
$saResults = mysql_query($szQuery, $dbConnection) or die ("2could not 
query venmar for security authentication.");
$obResults = mysql_fetch_row($saResults)

echo "$obResults[0], $obResults[1], $obResults[2], $obResults[3], 
$obResults[4], $obResults[5]";


The MySQL Database has it's own dedicated machine running on OpenBSD 
2.9. The web server accessing the MySQL Database is on it's own machine 
with Apache 1.3.12 and OpenBSD 2.9. Any other details needed let me know.

+--+---+
| Variable_name| Value |
+--+---+
| Aborted_clients  | 0 |
| Aborted_connects | 6 |
| Bytes_received   | 4125  |
| Bytes_sent   | 45247 |
| Connections  | 15|
| Created_tmp_disk_tables  | 0 |
| Created_tmp_tables   | 0 |
| Created_tmp_files| 0 |
| Delayed_insert_threads   | 0 |
| Delayed_writes   | 0 |
| Delayed_errors   | 0 |
| Flush_commands   | 1 |
| Handler_delete   | 4 |
| Handler_read_first   | 7 |
| Handler_read_key | 16|
| Handler_read_next| 2 |
| Handler_read_prev| 0 |
| Handler_read_rnd | 0 |
| Handler_read_rnd_next| 2597  |
| Handler_update   | 1 |
| Handler_write| 4 |
| Key_blocks_used  | 4 |
| Key_read_requests| 28|
| Key_reads| 4 |
| Key_write_requests   | 18|
| Key_writes   | 12|
| Max_used_connections | 1 |
| Not_flushed_key_blocks   | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables  | 22|
| Open_files   | 44|
| Open_streams | 0 |
| Opened_tables| 38|
| Questions| 135   |
| Select_full_join | 0 |
| Select_full_range_join   | 0 |
| Select_range | 0 |
| Select_range_check   | 0 |
| Select_scan  | 15|
| Slave_running| OFF   |
| Slave_open_temp_tables   | 0 |
| Slow_launch_threads  | 0 |
| Slow_queries | 0 |
| Sort_merge_passes| 0 |
| Sort_range   | 0 |
| Sort_rows| 0 |
| Sort_scan| 0 |
| Table_locks_immediate| 52|
| Table_locks_waited   | 0 |
| Threads_cached   | 0 |
| Threads_created  | 14|
| Threads_connected| 1 |
| Threads_running  | 1 |
| Uptime   | 7235  |
+--+---+

+-+---+
| Variable_name   | Value 
 
|
+-+---+
| ansi_mode   | OFF 
 
|
| back_log| 50 
 
|
| basedir | /usr/local/ 
 
|
| binlog_cache_size   | 32768 
 
|
| character_set   | latin1 
 
|
| character_sets  | latin1 dec8 dos german1 hp8 koi8_ru 
latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr 
win1251ukr greek win1250 croat cp1257 latin5 |
| concurrent_insert   | ON 
 
|
| connect_timeout | 5 
 
|
| datadir | 

RE: [PHP-DB] Using A Query Results Multiple Times

2001-10-24 Thread Adam Douglas

Yes, I had the right code just was missing the mysql_data_seek. Thanks for
the help.


> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 1:09 PM
> To: 'Adam Douglas'; PHP-DB (mailing list) (E-mail)
> Subject: RE: [PHP-DB] Using A Query Results Multiple Times
> 
> 
> You're on the right track.  Did you try?:
> 
> while( $row[] = mysql_fetch_array($result) );
> 
> This should load each result row into a row of a 
> multi-dimensional array.
> 
> You would then access it with:
> 
> $row[0]['colname']
> 
> -Original Message-
> From: Adam Douglas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 1:48 PM
> To: PHP-DB (mailing list) (E-mail); PHP-General (mailing 
> list) (E-mail)
> Subject: [PHP-DB] Using A Query Results Multiple Times
> 
> 
>   I have an instance where I have to query my MySQL 
> database and then
> use the multiple row results to create multiple pull down 
> menus on a web
> page. My problem is how can I take the results of the query 
> and use them
> more the once to create pull down menus? I've always used a 
> while look to
> fetch each row of the results and have it create the pull 
> down menu as it
> goes through each row. But doing it this way only stores one 
> row of results
> in a variable. Is there a way I can grab all the results from 
> a query that
> would go into an array so I could use it multiple times? I've looking
> briefly for a function to MySQL that would allow me to do 
> this but haven't
> found anything unless I misunderstand mysql_fetch_array 
> function. At first I
> thought I could loop through my while loop and have it put 
> the results from
> the query of each row in to a multidimensional array. But 
> then how would I
> add to the array after the initial row?
> 
> BTW, I'm using PHP 3.0.16 so I can't use the added array 
> functions that
> PHP 4 has. I do plan on upgrading soon.
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Using A Query Results Multiple Times

2001-10-24 Thread Adam Douglas

Thanks for the help. I had all the code right just had to add the
mysql_data_seek. Wasn't aware it operated in this manner.


> -Original Message-
> From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 3:41 PM
> To: Adam Douglas; PHP-DB (mailing list) (E-mail); PHP-General (mailing
> list) (E-mail)
> Subject: RE: [PHP-DB] Using A Query Results Multiple Times
> 
> 
> Hi
> 
> while(...)
> {
> do whatever
> }
> 
> mysql_data_seek ($mysqlresultid, 0)
> 
> while(...)
> {
> do whatever
> }
> 
> mysql_data_seek ($mysqlresultid, 0)
> etc
> 
> will set the pointer back to the beginning of the result set, 
> so you can
> scan through it as many times as you need to, without needing 
> to repeat the
> query.
> 
> 
> HTH
> 
> Peter
> 
> > -Original Message-
> > From: Adam Douglas [mailto:[EMAIL PROTECTED]]
> > Sent: 23 October 2001 19:48
> > To: PHP-DB (mailing list) (E-mail); PHP-General (mailing 
> list) (E-mail)
> > Subject: [PHP-DB] Using A Query Results Multiple Times
> >
> >
> > I have an instance where I have to query my MySQL 
> database and then
> > use the multiple row results to create multiple pull down 
> menus on a web
> > page. My problem is how can I take the results of the query 
> and use them
> > more the once to create pull down menus? I've always used a 
> while look to
> > fetch each row of the results and have it create the pull 
> down menu as it
> > goes through each row. But doing it this way only stores one row
> > of results
> > in a variable. Is there a way I can grab all the results 
> from a query that
> > would go into an array so I could use it multiple times? 
> I've looking
> > briefly for a function to MySQL that would allow me to do 
> this but haven't
> > found anything unless I misunderstand mysql_fetch_array function.
> > At first I
> > thought I could loop through my while loop and have it put the
> > results from
> > the query of each row in to a multidimensional array. But 
> then how would I
> > add to the array after the initial row?
> >
> > BTW, I'm using PHP 3.0.16 so I can't use the added array
> > functions that
> > PHP 4 has. I do plan on upgrading soon.
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Using A Query Results Multiple Times

2001-10-23 Thread Adam Douglas

I have an instance where I have to query my MySQL database and then
use the multiple row results to create multiple pull down menus on a web
page. My problem is how can I take the results of the query and use them
more the once to create pull down menus? I've always used a while look to
fetch each row of the results and have it create the pull down menu as it
goes through each row. But doing it this way only stores one row of results
in a variable. Is there a way I can grab all the results from a query that
would go into an array so I could use it multiple times? I've looking
briefly for a function to MySQL that would allow me to do this but haven't
found anything unless I misunderstand mysql_fetch_array function. At first I
thought I could loop through my while loop and have it put the results from
the query of each row in to a multidimensional array. But then how would I
add to the array after the initial row?

BTW, I'm using PHP 3.0.16 so I can't use the added array functions that
PHP 4 has. I do plan on upgrading soon.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] bulk miorting rows into mysql db

2002-12-13 Thread Adam Williams
use mysqlimport, its a program that comes with MySQL.  go to www.mysql.com
and click on documentation to learn more about it.

Adam

On Fri, 13 Dec 2002, mikek wrote:

> I have a few hundred rows of data to import into a mysql db. Its currently
> tab separated.
>
> What's the most straight forward way (ie i dont want to enter it line by
> line) of doing a bulk import?
>
> I have full admin rights to my dev server. Is there a method or software app
> that people can recommend to me.
>
> Much appreciated.
>
> ---
> Mike Karthauser - email:[EMAIL PROTECTED] - phone:0117 9426653
> brightstorm - curiously online - http://www.brightstorm.co.uk
>
>
>


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




Re: [PHP-DB] Get error message, need help

2002-12-16 Thread Adam Voigt




Your missing a semicolon (;) after your first "$myquery =" line.



- Original Message -

From: "David" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>

Sent: Monday, December 16, 2002 2:16 AM

Subject: [PHP-DB] Get error message, need help





> Hello all,

>

> I am new to PHP so I am going to need some help.

>

> I am trying to create a admin login page. But I am getting this error

> message:

>

> Parse error: parse error, unexpected T_VARIABLE in c:\program files\apache

> group\apache\htdocs\sunwestsilver\admin\tmpi5pcf76sy9.php on line 43

>

> tmpi5pcf76sy9.php is generated by Dreamweaver MX as a temp file from

> admin.php

>

> It is coming  from this line:

>

> this is line 43 code

>

> # $myquery = .'" AND password = '" . crypt($password, "xpz8ty") . "'";

>

> The complete code is:

>

> // Query Database with username and encrypted password

>   #$myquery = "SELECT * FROM user WHERE username = '" . $user

>   #$myquery = .'" AND password = '" . crypt($password, "xpz8ty") . "'";

>   #$result = mysql_query($myquery);

>   #if (!$result)

>   #{

>   #  $error = "Cannot run Query";

>  #return($error);

>   #}

>

> Any help will be nice.

>

> I got this code from Dreamweaver MX: PHP Web Development pg. 257

>

> Thanks

>

> David

>

>

>

> --

> 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






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] keyword search a mysql database.

2002-12-18 Thread Adam Voigt




$searchstring = $_POST[searchfor];

$searchstring = str_replace(" ","%",$searchstring);



mssql_query("SELECT id FROM table WHERE field LIKE '$searchstring';");



This will give you a looser search where all search terms have

to be there, but not necessarily next to each other, if you want a "phrase search"

so they have to follow each other:



$searchstring = "%" . $_POST[searchfor] . "%";



mssql_query("SELECT id FROM table WHERE field LIKE '$searchstring';");



Make sense?



On Wed, 2002-12-18 at 12:44, mike karthauser wrote:

I'm looking for tips and tricks in how to approach building a keyword search

over an number of fields in a courses database.



I know how i can search for one word at a time, but i am not sure on how i

would approach searching via a defined string.



Anyone got any good pointers for doing this/ or some tutorial that i can

read though?



Thanks..



BTW kettles on if anyone wants a brew..

-- 

Mike Karthauser 

Managing Director - Brightstorm Ltd



Email   >> [EMAIL PROTECTED]

Web >> http://www.brightstorm.co.uk

Tel >> 0117 9426653 (office)

   07939 252144 (mobile)



Snailmail   >> Unit 8, 14 King Square,

   Bristol BS2 8JJ





-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: Finding zipcode within radius of another zipcode.

2002-12-25 Thread Adam Royle
There are databases / packages you can buy which already have this 
information in them. A simple search for 'purchase postcode database' 
on Google gave me a few leads.

Adam

Hi folks,

I'm building a PHP/MySQL database for a customer. It's an advanced 
mailing
list for a band. They want to be able to send e-mails targetted to 
people
around where a gig takes place. For instance, if a concert is taking 
place
somewhere in the 42071 zipcode, they want to e-mail everyone within 500
miles of 42071. The database will have around 10,000 members, with 
e-mail
and mailing addresses.

Does anyone have a good idea for this?

Thanks a ton,

John Thile (gilrain)
http://lunarpolicy.net


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




Re: [PHP-DB] Help with FTP

2002-12-27 Thread Adam Williams
use system() to run /bin/df

depending on the OS you might need to add a flag to it like -h (linux) or
-k (solaris).

www.php.net/system

Adam

On Fri, 27 Dec 2002, Dankshit wrote:

> Is there a way to see how much space is left in a ftp server?
>
> thanks in advance!
>


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




[PHP-DB] Re: File Upload ---Thanks!

2003-01-07 Thread Adam Royle
Yep. Been using Mac OS X (10.1 - 10.2.3) with mySQL no problems. I 
built it from source first time, but now I just use Mac OS X packages 
from Mark Liyanage. You can find them here. Also he has a good 
pre-compiled PHP4 you can download and use.

http://www.entropy.ch/software/MacOSx/mysql/

Adam


Thanks folks - persistence pays off and so does group discussions . I 
had chmodded the uploads directory to 777 but it was within the 
public_html directory with different file permissions so I guess 
public_html permissions were taking presidence. After reading all of 
your suggestions... a little light turned on and I moved the uploads 
directory outside of the public-html directory and Volia!

Uploading file...
File uploaded successfully

Preview of uploaded file contents:
THIS IS A TEST.


Thanks Again.
Anyone using a Macintosh with MySql? That is my next goal.


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




[PHP-DB] Re: mysql_errno() list?

2003-01-10 Thread Adam Royle
Just use a combination of mysql_errno() and mysql_error():

 echo mysql_errno() . ": " . mysql_error(). "\n";

Adam

PS. Documentation always rocks!


Hi guys,
I've been playing with PHP for a while now, and love the mysql 
functions,
but there's one thing I'd like to know...

I want to check if a mysql error is a certain number, and thats all 
fair
enough because every time i encounter an error I can write down what 
that
error was. However, it would be handy if I could have my own define 
file
with all the errors in. Can I ask if anyone has a list of errors and 
their
numbers for mysql_errno? I've looked on the web and found a load of 
errors
for the mysql daemon (the page told me to look in
/usr/share/mysql/mysql_errors.txt) but this isnt the file I want as the
errors there relate to the server and not errors with a query I'm 
running

Thanks in advance for any help

James Booker
EMPICS Sports Photo Agency
http://www.empics.com


Re: [PHP-DB] data move

2003-01-13 Thread Adam Voigt




Umm, if it's a one time deal, why not just have access output a CSV (comma seperated version, or something like that)

and use PHP or phpMyAdmin if it will do it, to do your insert's? That way you don't have to have PHP interface with

Access, just the MySQL part which is real easy.



On Mon, 2003-01-13 at 09:12, Edward Peloke wrote:

Ok, I know I have asked this question several times but it is time for me to

start coding so I am looking for some goog tutorials somewhere.  I need to

use php to transfer data from an access file to mysql db.  I assume I will

just use an odbc connection but I am unsure as to where to start.  If anyone

knows of any good tutorials or samples, please point me in the right

direction.



Thanks,

Eddie





-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php

    
    



-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] javascript and submitting forms

2003-01-14 Thread Adam Royle
Hi Mignon,

This should work, never closing the window without submitting  
(foolproof). Just add some error checking, and you'll be sweet as a  
nut! All I did was add the echo statement underneath the data insert.

Adam



include ('dbconn.php');
if(isset($submit))
	 {
	$query = "INSERT INTO `comments` (  `track_id`, `cat_comments` )  
VALUES ( '0', '$comm' );";
	mysql_query ($query, $link );
	
	echo 'window.close();';
		
	}
?>







Enter your details here:









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



RE: [PHP-DB] Send mail with a file

2003-01-16 Thread Adam Voigt




Unix has nothing to do with it, the mail command in PHP on unix is the same mail command

in PHP on windows. If you want to use attachments you need to use a class like phpMimeEmail

or whatever it's called go to phpclasses.org, it's on there somewhere.



On Thu, 2003-01-16 at 09:33, NIPP, SCOTT V (SBCSI) wrote:

	Under Unix I don't know that this is possible, but hopefully someone

else will know of a way.  I would love to be able to e-mail some Excel files

that I generate with a Perl cron job, but there does not appear to be any

practical way to do this in Unix.



-Original Message-

From: Bruno Pereira [mailto:[EMAIL PROTECTED]]

Sent: Thursday, January 16, 2003 3:47 AM

To: [EMAIL PROTECTED]; [EMAIL PROTECTED]

Subject: [PHP-DB] Send mail with a file





How can i insert a file on a mail, with the command "mail()"? It is

possible?



Cumprimentos



Bruno Pereira

[EMAIL PROTECTED]



-Original Message-

From: Bruno Pereira [mailto:[EMAIL PROTECTED]]

Sent: quarta-feira, 15 de Janeiro de 2003 14:48

Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]

Subject: Concatenate two strings





How can i join two strings.

My code is something like:

$valor1="bruno";

$valor2="Pereira";

$valor=$valor1 + " " + $valor2



Can someone help me. Thanks.



Cumprimentos



Bruno Pereira

[EMAIL PROTECTED]





-- 

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






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: Email to a list of address in your database.

2003-01-19 Thread Adam Royle
This should work. You were on the right track, although you might want to
use better var names so you don't get confused. You can see I have changed
them to what I would normally use.

Adam


mail To all my list


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




[PHP-DB] Re: Using strlen and substr to Shorten DB Results

2003-01-26 Thread Adam Royle
Try this. PHP arrays are cool! Of course there are tidier ways to  
implement this, but this is just an example.

Adam

<-- Code -->

$getscname = mysql_query("SELECT * FROM subcat WHERE subcatid =  
'$subcatid'") or die ("Couldn't get the info.".mysql_error());

while($sub_cat = mysql_fetch_array($getscname)){
	$subcat_id = $sub_cat['subcatid'];
	$subcat_name = $sub_cat['subcatname'];

	$arrCats[] = ''.$subcat_name.'';
}
	
echo  
implode('|',$arrCats);

<-- Code -->


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



[PHP-DB] Re: Images-weird!!

2003-02-02 Thread Adam Royle
Hi Mihai,

Didn't try your code, but noticed your comment on colours. RBG values go from 0 - 255, 
not 1 - 256, so this may be your problem.

Adam



Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread Adam Voigt




$query = mysql_query("SELECT UNIX_TIMESTAMP(fieldname) AS date WHERE id = '1';");

$array = mysql_fetch_array($query);



$mydate = date("j F, Y",$array[date]);



Change fieldname and the where clause, and that should work.

If you want to further munipulate how it looks, just look at the

date manual page:



http://www.php.net/date



And change the first parameter to the date function.





On Mon, 2003-02-03 at 09:09, RUBANOWICZ Lisa wrote:

Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page.  However I want to show it as 

"2 February, 2003"

or "2 February"

Can someone please help me.  The date will not necessarily be todays date (I looked at the datetime() function and the getdate() function but couldn't work it out for these)

Thanks for your support

All the best

Lisa



Lisa Rubanowicz

CNH Ireland

Tel: +353 46 77663

Email:   [EMAIL PROTECTED]
    


 








-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] Storing iterated results into various variables

2003-02-04 Thread Adam Voigt




$counter = 1;

$query = mysql_query("SELECT image,caption FROM tablename ORDER BY id;");



while($row = mysql_fetch_array($query))

{



$imagevar = "image" . $counter;

$captionvar = "caption" . $counter;



$$imagevar = $row[image];

$$captionvar = $row[caption];



$counter++;



}



Change the query to match what you need, and that should work, if

your interested, check out the manual page on "Variable Variables" at: 



http://www.php.net/manual/en/language.variables.variable.php



Enjoy.



On Tue, 2003-02-04 at 07:02, Geckodeep wrote:

May be some one could help me here, I am trying to retrieve results from a

table that gives 9 rows, from each row I am trying to pull out two fields

and assign the two values of those column fields to a variable $image1 and

$caption1, and now I want to go to the next row and pick up the values of

the corresponding fields and store it in the next variable $image2 and

$caption2 and to continue until I reach 9 rows.



The reason for this technique is I am trying to inject the dynamic data

inside a page which is already formatted with HTMLs (kind of template) and

by means of Php tags I can echo these variables where needed.







Thanks for your time and help in advance I'd appreciate it.







GD







-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


RE: [PHP-DB] A little JOIN help please...

2003-02-04 Thread Adam Royle
SELECT B.Title FROM phpCalendar_Details AS B, phpCalendar_Daily AS A
WHERE A.CalendarDetailsID = B.CalendarDetailsID AND CURDATE(  )  BETWEEN
A.StartDate AND A.StopDate





Also, you don't need to use the backticks around field names unless they contain 
spaces or other reserved words and characters.

Adam



RE: [PHP-DB] collaborating on a document

2003-02-11 Thread Adam Voigt




Riiight, anyway, since Adobe Acrobat is the worst possible answer for

updating in real time (and completely wouldn't work), I would say, yes,

two frames should work, but you might even want a third (hidden) at the

bottom that never stops executing, just pulling entry's out when new ones

are added, and use _javascript_ to add them to the right frames with the ideas.



On Tue, 2003-02-11 at 10:16, Hutchins, Richard wrote:

1. This question has nothing to do with PHP or databases.

2. Adobe already thought of it: Adobe Acrobat 5.0.



> -Original Message-

> From: Baumgartner Jeffrey [mailto:[EMAIL PROTECTED]]

> Sent: Tuesday, February 11, 2003 10:13 AM

> To: [EMAIL PROTECTED]

> Subject: [PHP-DB] collaborating on a document

> 

> 

> I'm thinking about making a little tool where people can 

> contribute ideas in

> real time. Thus far, the best way I can see to do this is via 2 frames

> 

> Frame 1: for entering data - which is inserted into a table. 

> 

> Frame 2: would select from the table.  It would also refresh 

> frequently -

> say every 30 seconds.

> 

> But perhaps you have a more elegant solution?

> 

> Thanks,

> 

> Jeffrey Baumgartner

> 

> eBusiness Consultant - ITP Europe

> http://www.itp-europe.com

> [EMAIL PROTECTED]

> +32 2 721 51 00

> 

> 

> -- 

> 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






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


RE: [PHP-DB] collaborating on a document

2003-02-11 Thread Adam Voigt




Ofcourse then everyone has to have Adobe installed, which is probably less likely

then having _javascript_ enabled.



On Tue, 2003-02-11 at 10:39, Hutchins, Richard wrote:

Actually, Adobe 5.0 implemented on a server in Assembled or Integrated

(their words, not mine) configuration DOES allow for real-time document

collaboration. Whether this solution would actually solve the problem is

determined by the requirements of the collaboration environment.



If you're thinking Acrobat 4.0, you're absolutely right. Real-time

collaboration is, for all practical purposes, non-existent.



I'm not going to get into any further debate because it's off topic and all

of the information is available on Adobe.com, specifically in the following

links:

http://www.adobe.com/products/acrobat/pdfs/acr05_review_wp.pdf

and, more generally, http://www.adobe.com/acrofamily/collaboration.html.



In regards to actually implementing a solution using JS, yes can work, but

you're walking what can be a tight rope on client-side configuration. Some

of the standard issues are:

1. You have to make sure your users all have JS enabled or your app won't

work.

2. You'll have to write cross-browser compatible code back to v. 4.0

browsers as a standard.

3. Refreshing a screen every 30 seconds is going to really tick off users

that don't have DSL or better connections.



These issues are certainly not insurmountable. All of the above concerns can

be alleviated, if not eliminated, if you're going to implement on an

intranet where you have control over what clients are used. But in the WWW

arena, you just don't know what clients are going to be used.
    
-Original Message-

From: Adam Voigt [mailto:[EMAIL PROTECTED]]

Sent: Tuesday, February 11, 2003 10:25 AM

To: [EMAIL PROTECTED]

Cc: [EMAIL PROTECTED]

Subject: RE: [PHP-DB] collaborating on a document





Riiight, anyway, since Adobe Acrobat is the worst possible answer

for 

updating in real time (and completely wouldn't work), I would say, yes, 

two frames should work, but you might even want a third (hidden) at the 

bottom that never stops executing, just pulling entry's out when new ones 

are added, and use _javascript_ to add them to the right frames with the

ideas. 



On Tue, 2003-02-11 at 10:16, Hutchins, Richard wrote: 

1. This question has nothing to do with PHP or databases. 

2. Adobe already thought of it: Adobe Acrobat 5.0. 



> -Original Message- 

> From: Baumgartner Jeffrey [mailto:[EMAIL PROTECTED]] 

> Sent: Tuesday, February 11, 2003 10:13 AM 

> To: [EMAIL PROTECTED] 

> Subject: [PHP-DB] collaborating on a document 

> 

> 

> I'm thinking about making a little tool where people can 

> contribute ideas in 

> real time. Thus far, the best way I can see to do this is via 2 frames 

> 

> Frame 1: for entering data - which is inserted into a table. 

> 

> Frame 2: would select from the table. It would also refresh 

> frequently - 

> say every 30 seconds. 

> 

> But perhaps you have a more elegant solution? 

> 

> Thanks, 

> 

> Jeffrey Baumgartner 

> 

> eBusiness Consultant - ITP Europe 

> http://www.itp-europe.com 

> [EMAIL PROTECTED] 

> +32 2 721 51 00 

> 

> 

> -- 

> 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 



-- 

Adam Voigt ([EMAIL PROTECTED])

The Cryptocomm Group

My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
    


-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB]

2003-02-12 Thread Adam Voigt




Very first result on google:



http://www.oreillynet.com/cs/user/view/cs_msg/7231



Look at the first reply.

(Next time go to google first.)



On Wed, 2003-02-12 at 08:40, nikos wrote:

Hi List!



I'm trying to Drop a Table and aI get an error as follows:

"Error on delete of './horceng/oikology.MYI' (Errcode: 13)"



Does anybody know what is the error 13?

Thanks





Qbit

Γατσής Νίκος - Gatsis Nikos

Web developer

tel.: 2108256721 - 2108256722

fax: 2108256712

email: [EMAIL PROTECTED]

http://www.qbit.gr 




-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: Web Page Caching

2003-02-16 Thread Adam Royle
This may not be true in your case, but I remember another user on this list claiming a 
similar thing, and his problem was actually code-related. He had his db update code 
*AFTER* the results were displayed (ie. doing edit and save on same page).

Check your programming logic. Just a note to people out there who may not have much 
programming experience - try doing all of your server-side processing (or at least db 
and filesystem calls, etc) before you output any data, this way you can implement 
error checking etc and still use the header() function, etc. 

Adam


--- Original Message ---

Hello,

I don't know if this is the right list to send this question to.  It appears that the 
browser caches the result after a PHP page updates the database.  I have to manually 
reload it in order to see the updates.  Does anyone know how to overcome this?

Thanks,

Philip



[PHP-DB] Re: Recordsets and associative arrays

2003-02-17 Thread Adam Royle
Hi Don,

Use this process:

 $value){
$data[$row][$key] = $value;
   }
   $row++;
  }

?>

The array structure would be something like this:

$data[0]['Name'] = 'Name 1';
$data[0]['Address'] = 'Address1';
$data[0]['City'] = 'City1';
$data[1]['Name'] = 'Name 2';
$data[1]['Address'] = 'Address2';
$data[1]['City'] = 'City2';
$data[2]['Name'] = 'Name 3';
$data[2]['Address'] = 'Address3';
$data[2]['City'] = 'City3';

etc etc

HTH Adam

- Original Message -
Message-ID: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
From: "Don Briggs" <[EMAIL PROTECTED]>
Date: Mon, 17 Feb 2003 16:42:51 -0600
Subject: Recordsets and associative arrays

Hello.

I am having a problem with syntax. Here is what I am doing. I have the
follwing table

|Name|Address  |City|
=
|Name 1 | Address1   | City1 |
|Name 2 | Address2   | City2 |
|Name 3 | Address3   | City3 |
|Name 4 | Address4   | City4 |
=

I can fetch a single record into an associative array. But I need to put
these records into an multi-dimentional associatave array. I have tried to
figure out what the syntax should be, but it has not worked. The only thing
is that the key names will be different from the field names, and we won't
be putting all of the record fields into the table. So we can't just make an
array of the associative arrays returned by mysql_fetcharray($result). Hope
you can help me out.

Don!


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




Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Adam Voigt




Assuming your sorting by id, just do:



SELECT TOP 50 * FROM TABLE WHERE id > $lastid



And just have lastid posting to the page every time

they hit next, and in lastid, put the last id of the results

on that page.



On Wed, 2003-02-19 at 09:59, Noam Giladi wrote:

I'm trying to split results into different pages and number the pages

accordingly.  I've been able to build a fairly intelligent page numbering

system which knows which rows it should pull (at least by numbering each row

numerically) but I don't know how to construct a SQL query to pull 10

results starting at a certain number.



please  did anyone wrote a proc that do it?.









-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php

    




-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] "LIMIT" problem MSSQL

2003-02-19 Thread Adam Voigt




Well if you do, (sort by id) this will work.



On Wed, 2003-02-19 at 11:14, Noam Giladi wrote:

i'm not using a fixed sort



tnx  noam

  "Adam Voigt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

  Assuming your sorting by id, just do: 



  SELECT TOP 50 * FROM TABLE WHERE id > $lastid 



  And just have lastid posting to the page every time 

  they hit next, and in lastid, put the last id of the results 

  on that page. 



  On Wed, 2003-02-19 at 09:59, Noam Giladi wrote: 

I'm trying to split results into different pages and number the pages 

accordingly. I've been able to build a fairly intelligent page numbering 

system which knows which rows it should pull (at least by numbering each row 

numerically) but I don't know how to construct a SQL query to pull 10 

results starting at a certain number. 



please did anyone wrote a proc that do it?. 









-- 

PHP Database Mailing List (http://www.php.net/) 

To unsubscribe, visit: http://www.php.net/unsub.php 



-- 

Adam Voigt ([EMAIL PROTECTED])

The Cryptocomm Group

My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

   






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: Using results from one mysql query to make another

2003-02-27 Thread Adam Royle
SELECT b.name FROM apliexperts a LEFT JOIN experts b ON a.expid = b.id 
WHERE softid = 2

I have a table that includes the ids of software
aplications and experts (apliexperts). My page is
loaded with the variable of the software id (softid),
which it uses to match the experts for that software.
But instead of returning just the expert id (expid),
to use that expid to get the full row entry from the
"experts" table.
So if my apliexperts table has the rows:
[softid] [expid] [id]
   3   0   0
   2   1   1
   2   2   3
And the experts table has:
[id] [Name]
  0paul
  1john
  2mark
It needs to return john and mark if the softid is 2.

thanks,

Jay

Re: [PHP-DB] What wrong in this SQL

2003-02-27 Thread Adam Voigt




A. Are you using a database that supports multitable deletes?

B. Try joining, like:



DELETE FROM cats a, articles b WHERE a.cat_id = $catid AND b.cat_id = $catid;



Let me know.



On Sat, 2003-03-01 at 01:03, Alawi shekh albaity wrote:

 What wrong with this code in sql : 

$SQLSTATEMENT["DeleteCategory"] = "

  DELETE FROM cats, articles

  WHERE cat_id = $catid

 ";



Error no:

 1064

Details :

You have an error in your SQL syntax near 'WHERE cat_id = 1 ' at line 4



-- 

PHP Database Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP-DB] Processing Page

2003-02-27 Thread Adam Royle
I have seen an example using JavaScript where javascript commands are flushed every so 
often (from PHP) which indicates a status bar process. It was used to monitor 
mailouts. The javascript commands were simply telling an image to increase it's width. 
Of course you have to have a system where you can gauge percentages of things done. 
Alternatively, you could simply use same method (without image), and after db stuff is 
done, output a javascript redirect.

The above is probably confusing, but ask me if you need more explanation.

Adam

-Original Message-
From: Aspire Something [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 2:56 PM
To: php-db
Subject: Re: [PHP-DB] Processing Page

Thanks every one ...

All the method you told me are static it does not look if the sql
statemet
being exec by php along with backend has finished its job . I only
wanted to
show the processig page till the time the query does it's work .

let me add here that the time for execution of the script here is
unpridictable and it is expected that it may vary according to the job
given
thus
I cannot hardcode the refresh time .

Regads,
V Kashyap


Re: [PHP-DB] Help with MySQL Logic

2003-03-03 Thread Adam Voigt




Heh. Sounds like a programming class homework project.

I would say through the clever use of where clauses's, like:



UPDATE position SET posistion = (position-1) WHERE position > $idremoved;



Would work, assuming $idremoved containted the position of the car removed.



On Mon, 2003-03-03 at 10:59, Rankin, Randy wrote:

Hello All,



This may be a bit off topic. If so, my apololgies. 



A client of mine, a rail car storage company, has asked that I create a

PHP/MySQL application in which they will maintain and track rail cars. I am

having a bit of trouble however working through one of thier requirements.

They need to know in what position the rail car is on each track. For

example, they might have a track called X which will hold 30 rail cars. They

would enter the car information for 30 cars and associate each of them with

track X. If one of the car owners decides to move car 3 out of storage, then

the remaining 29 cars must be re-numbered ( ie; car 1 and 2 would remain and

car 4-30 would become car 3-29 ). In the same manner, I need to be able to

add a car to the track once an empty slot is available. For example, If the

new car goes at the front of the track then it would become car 1 and the

remaining cars, originally numbered 1-29 would become 2-30. 



I hope I explained thourougly. Any suggestions would be appreciated. 



Randy




-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Re: Dynamic Variable names

2003-03-09 Thread Adam Royle
It's probably better to use arrays.

$tips[0] = "value";
$tips[1] = "value";
$tips[2] = "value";
Although, if you REALLY want dynamic variable names.

$i = 1;
$varname = 'tips_'.$i;
$$varname = "value";
this will make a variable like below:

$tips_1 = "value";

But like I said before, it's better to use arrays - they are much more 
flexible (and PHP arrays are especially cool).

http://www.php.net/manual/en/ref.array.php

adam

Just a quick question about dynamic variables

would like to end up with a variable called
$tips_1
$tips_2
...
$tips_n
where "n" is the value of the variable $sid

i have tried

$tips . '$sid';

and other variants, but i can't get one that doesn't return a parse 
error or T_VARIABLE error.


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


[PHP-DB] Re: adding to an array variable using a loop...?

2003-03-10 Thread Adam Royle
I assume the field 'date' in your database is a date field, and in your code
you are trying to do a date + 1, but you are not specifying *what* you are
adding to the date (ie. 1 day, 1 week, 1 month), therefore the whole
variable is being replaced (with a 1). Try looking at the various date
functions (or string functions) to work out how to do this. Depending on how
your date is setup you would use strtotime() or mktime() (or both).

Adam

--- Original Message ---
I want to create an array from results returned from a mysql query. I want
it to go through each row in the returned result, and if the variable in the
array staff exists add 1 to the total, if it doesnt exist, set it as one and
carry on.

But when i run this and do var_dump, it just returns "1" in the array for
every date.

I don't think my logic for this is correct, please help.
Cheers,
Dave.
==
$query = "SELECT * FROM Rota WHERE date >= $start and date <= ($start +
INTERVAL 6 DAY) ";
 $result = mysql_query($query);
 while ($row = mysql_fetch_array($result)){
  $x = 1;
  $date = $row['Date'];
  if ( isset($staff[$date] ) ){
   $staff[$date] = $staff[$date] + $x ;
  }
  else{
   $staff[$date] = $x ;
  }

 }


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



[PHP-DB] Re: PHP script execution - display issue

2003-03-13 Thread Adam Royle
This is neither a PHP nor database question. This is client side. 
Anyway, a simple fact is that tables won't render until the whole table 
has been loaded into memory (ie. it won't show until it reaches the 
 tag). If you have your whole site inside one big table, then 
this is what is causing your problems. Unfortunately, sometimes this 
unavoidable. To make it run sequentially, you could do this, or use 
divs with absolute positioning. just a thought.

Adam

Hello,
I have a display problem with one of my sites.
Because there is an big amount of information in the pages, which is
extracted from database, using IE browser I see only the background of
the site, and then, after a time, the whole page.
My client has recently requested to make something to improve the site
speed and display time.
So because all the site is done using the classes, and the information
is extracted through them, I reduced the instruction numbers, and I
compacted as much as I could the classes. But I still have the display
problem using IE browser : I see the background, and just after that I
see the whole site.
I mention that the classes are included, and the class function is
called through $this_class->function($parameters); Not all the classes
used in the page are called In the beginning; and another mention is
that the site pages contains 4 sections. Top, left, middle, & right.
My question is:
Is there a way to display sequentially the site. After the background,
to display the first section (top), then left part, middle part and
right part after that ?
Again, the site loads like this : the background, then the whole page.
This doesn't matter if I use dial-up or T1.
My client saw, for example, that cnn or yahoo site loads sequentially.
Knowing that yahoo is done in php, I'm wondering how they did it.
Thanks
Petre Nicoara


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


RE: [PHP-DB] Addslashes (MSSQL)

2003-03-20 Thread Adam Voigt
Umm, how about using str_replace to replace the quotes for there ASCII
equivalent's,
and when you print them out in HTML they will be interpreted properly,
or you
could str_replace them back.

On Thu, 2003-03-20 at 11:23, Poon, Kelvin (Infomart) wrote:

Actually, that eliminated the error messages but it still hasn't fix
the
problem

I did what you saidbut now in my MSSQL table, the content column
has
somethign like thsi

"Step 1: blah blah balh
Step 2: blah balh balh \'Username\'"

so it included the slashes...I just learned that mSSQL doens;t
accept
slashes so is there any other way I can fix this problem?..I want
literally

step 1: balh bah balh
Step 2: balhb alhb alhb 'Username'

to be inserted to the table..please help 

thanks a lot by the way

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 11:06 AM
To: Poon, Kelvin (Infomart); [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Addslashes (MSSQL)


> where my $content value is osmethign like this.
>
> "Step 1: Access the homepage
> Step 2: type in your username under the field 'username' "
>
> and after the addslashes funciton there would be \ around the
'username'
> like this..
> \'username\'and now after running this program I got an error
message:
>
> Warning: MS SQL message: Line 14: Incorrect syntax near
'username'.
> (severity 15) in
d:\apache_docroots\internal.infomart.ca\infodesk\kb_add.php
> on line 119

I think you need to replace ' with '' in MSSQL (one single quote
replaced
with two single quotes)

$text = str_replace("'","''",$old_text);

---John Holmes...


-- 
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


-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


[PHP-DB] Including Details in MySQL longer than 255 characters

2003-03-20 Thread Adam Venturella
Ok So I have my Database/Tables all set up.  What I wanna know how to do /
find a tutorial on is how I might go about  including details longer than
255 characters that are referenced by a mysql query.  So basically I have
some thing like this on the inputs:

First:
Last:
Email:
Comments:

Now the comments Section, I basically want to type in whatever I want.
Since that could be larger than 255 characters how do I get mysql to
reference that chunck of text in a query.  I imagine the text will have to
be stored outside the DB and read in to the HTML at an appropriate time or
done like a message board or something. I would also like to keep it
searchable. So that I could do a search through the whole DB and keep
comments included in that search  well maybe do a drop down that
references the various fields to search and if you select comments you would
get a select like "select * from data where comments =$input"

Anyway if someone could point me in the right direction I would be very
appreciative.

Adam
[EMAIL PROTECTED]



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



Re: [PHP-DB] Including Details in MySQL longer than 255 characters

2003-03-20 Thread Adam Venturella
Thanks,

I totally forgot about that type...
And thanks to everyone else who replied!

-a


"Mike Karthauser" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> on 20/3/03 6:11 pm, Adam Venturella at [EMAIL PROTECTED] wrote:
>
> > Anyway if someone could point me in the right direction I would be very
> > appreciative.
>
> Change your column type to TEXT rather than varchar(255)
>
> --
> Mike Karthauser
> Managing Director - Brightstorm Ltd
>
> Email   >> [EMAIL PROTECTED]
> Web >> http://www.brightstorm.co.uk
> Tel >> 0117 9426653 (office)
>07939 252144 (mobile)
>
> Snailmail   >> Unit 8, 14 King Square,
>Bristol BS2 8JJ
>



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



[PHP-DB] RE: MySql Help needed

2003-03-31 Thread Adam Douglas
Are you sure you give access to this user from the machine to the database
server? Check IP address permissions and if the user has access to the
specific table and/or database in MySQL. Also check to make sure the
database server is setup to allow you access from your machine.. check the
MySQL and System log files they usually help to determine what went wrong.

> -Original Message-
> From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 29, 2003 9:12 PM
> To: [EMAIL PROTECTED]
> Subject: MySql Help needed
> 
> 
> Greetings!
> 
> I am building an application in PHP and am creating a global 
> $connect_id for MySql. I have MySql on a separate machine and 
> am using the connect like this:
> 
> $server = "development.myservermachine.net";
> $username = "myname";
> $password = "mypassword";
> $connect_id = mysql_connect($server, $username, $password);
> 
> All I get is 'Access denied for user '[EMAIL PROTECTED]' (Using 
> password:YES)
> 
> Now, I know I'm in the DNS server for my system, and the 
> username and password are correct as I checked the User table.
> 
> Any thoughts, ideas, etc. toward fixing this problem??
> 
> I'd appreciate any help provided.
> 
> Robin Kopetzky
> Black Mesa Computer/Internet Services
> 
> 
> 

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



Re: [PHP-DB] Connect Microsoft SQL database with php on unix

2003-04-01 Thread Adam Voigt
You need to compile the FreeTDS library (freetds.org),
and on your PHP configure line, add "--with-sybase=/usr/local/freetds"
replacing the path for where you installed FreeTDS.

And yes, it says Sybase, but no, you don't use the sybase
functions, you can still use all the mssql_whatever functions.

On Mon, 2003-03-31 at 13:40, Greg Cirino wrote:
> >Maybe mssql_connect()??
> >
> >www.php.net/mssql_connect
> 
> 
> The documentation indicates using sybase_connect (etc...) unless you
> are on a windows machine.
> 
> But that doesn't work either as the sybase.so file seems to be
> non-existant (on my machine anyway)
> 
> Regards
> Greg Cirino
> 
> 
> "John W. Holmes" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I would like to know the best way to connect to SQL database(which
> located
> > on Microsoft SQL Server) from PHP(Located on Unix Server).
> 
> Maybe mssql_connect()??
> 
> www.php.net/mssql_connect
> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
> 
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


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



Re: [PHP-DB] Problem with php/mysql and ISS on windows XPprofeesional

2003-06-03 Thread Adam Voigt
If your missing the dollar sign then add it, if your not, then
set error_reporting in your php.ini to "E_ALL & ~E_NOTICE".



On Mon, 2003-06-02 at 10:52, Cal Evans wrote:
> Sounds like you left off a $ when using a variable.  I would take a look at
> line 158, find the variable name and make sure it's $name. Disabling the
> error will cause the message to go away but not fix the problem.
> 
> humbly,
> =C=
> * Cal Evans
> * http://www.christianperformer.com
> * Stay plugged into your audience
> * The measure of a programmer is not the number of lines of code he writes
> but the number of lines he does not have to write.
> *
> 
> - Original Message -
> From: "Ahmed Abdelaliem" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, June 02, 2003 9:50 AM
> Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional
> 
> 
> > hi
> > i use php and mysql on IIS server on windows xp professional
> > when i select anything from the database i get this :
> > "Notice: Use of undefined constant name - assumed 'name' in
> > d:\inetpub\wwwroot\EGYCDS\index.php on line 158
> > Spy Hunter"
> >
> > while evrything is going fine when i upload it on the web and it returns
> > only "Spy Hunter"
> >
> > i think  i have to disable this eroor message only
> > can any one tell me how i disable that error message
> >
> > _
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
-- 
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] Problem with php/mysql and ISS on windowsXPprofeesional

2003-06-03 Thread Adam Voigt
Ok, like I said, if it is an error (like a missing dollar sign) then
put the dollar sign in, therefore fixing the problem. However, if there
is not an error and he is simply using a variable and PHP is complaining
it's not defined, that's not a big deal, thats why it doesn't make the
code fail. It just means it noticed you accessed the variable $whatever
without making sure it was defined before you checked if it was false,
etc. No big deal, thats why the majority of PHP install's set the
error_reporting to ignore E_NOTICE, because it's completely safe to do
so.

On Mon, 2003-06-02 at 10:58, Cal Evans wrote:
> Again, changing the error reporting level will not fix the problem.  Since
> he is getting a warning AND his code is acting unexpectedly, he probably
> needs to concentrate on fixing the problem. (At least I assume that there is
> a problem. It sounds like there is from his description.)
> 
> humbly,
> =C=
> 
> * Cal Evans
> * http://www.christianperformer.com
> * Stay plugged into your audience
> * The measure of a programmer is not the number of lines of code he writes
> but the number of lines he does not have to write.
> *
> 
> - Original Message -
> From: "Adam Voigt" <[EMAIL PROTECTED]>
> To: "Ahmed Abdelaliem" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, June 02, 2003 9:59 AM
> Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows
> XPprofeesional
> 
> 
> > If your missing the dollar sign then add it, if your not, then
> > set error_reporting in your php.ini to "E_ALL & ~E_NOTICE".
> >
> >
> >
> > On Mon, 2003-06-02 at 10:52, Cal Evans wrote:
> > > Sounds like you left off a $ when using a variable.  I would take a look
> at
> > > line 158, find the variable name and make sure it's $name. Disabling the
> > > error will cause the message to go away but not fix the problem.
> > >
> > > humbly,
> > > =C=
> > > * Cal Evans
> > > * http://www.christianperformer.com
> > > * Stay plugged into your audience
> > > * The measure of a programmer is not the number of lines of code he
> writes
> > > but the number of lines he does not have to write.
> > > *
> > >
> > > - Original Message -
> > > From: "Ahmed Abdelaliem" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, June 02, 2003 9:50 AM
> > > Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP
> profeesional
> > >
> > >
> > > > hi
> > > > i use php and mysql on IIS server on windows xp professional
> > > > when i select anything from the database i get this :
> > > > "Notice: Use of undefined constant name - assumed 'name' in
> > > > d:\inetpub\wwwroot\EGYCDS\index.php on line 158
> > > > Spy Hunter"
> > > >
> > > > while evrything is going fine when i upload it on the web and it
> returns
> > > > only "Spy Hunter"
> > > >
> > > > i think  i have to disable this eroor message only
> > > > can any one tell me how i disable that error message
> > > >
> > > > _
> > > > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > > > http://join.msn.com/?page=features/junkmail
> > > >
> > > >
> > > > --
> > > > PHP Database Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > --
> > 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
> >
> >
-- 
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] Problem with php/mysql and ISS on windows XPprofeesional

2003-06-03 Thread Adam Voigt
Put single quote's around name in your record array, example:

Use:

$record['name']

Instead Of:

$record[name]


On Mon, 2003-06-02 at 11:04, Ahmed Abdelaliem wrote:
> here is the code i wrote
> i didn't miss the $ sign
> and it works fine on web
> but returns the error message when i use it on localhost
> 
> 
>  @ $db = mysql_connect("localhost");
> mysql_select_db("cds");
> $test_tr = mysql_query("select name from newpcgames order by gameid desc 
> LIMIT 0,
> 10");
> $test_tr1 = mysql_query("select name from newpcgames order by gameid desc 
> LIMIT 10,
> 20");
> 
> 
> while($record = mysql_fetch_array($test_tr))
>   {
> 
>   $record1= mysql_fetch_array($test_tr1);
> 
> echo "
> 
>  onmouseout=\"this.bgColor='475674'\" bgColor=#475674 width=\"50%\">
>  color=#ff size=1>";
>   echo stripslashes($record[name]);
>   echo "  ";
>   echo " onmouseover=\"this.bgColor='00'\" onmouseout=\"this.bgColor='475674'\" 
> bgColor=#475674 width=\"50%\">
>  color=#ff size=1>";
>  echo stripslashes($record1[name]);
>  echo "
>";
>   }
> 
> 
>   ?>
> 
> 
> >From: "Cal Evans" <[EMAIL PROTECTED]>
> >To: "Ahmed Abdelaliem" 
> ><[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
> >Subject: Re: [PHP-DB] Problem with php/mysql and ISS on windows XP 
> >profeesional
> >Date: Mon, 2 Jun 2003 09:52:21 -0500
> >
> >Sounds like you left off a $ when using a variable.  I would take a look at
> >line 158, find the variable name and make sure it's $name. Disabling the
> >error will cause the message to go away but not fix the problem.
> >
> >humbly,
> >=C=
> >* Cal Evans
> >* http://www.christianperformer.com
> >* Stay plugged into your audience
> >* The measure of a programmer is not the number of lines of code he writes
> >but the number of lines he does not have to write.
> >*
> >
> >- Original Message -
> >From: "Ahmed Abdelaliem" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Monday, June 02, 2003 9:50 AM
> >Subject: [PHP-DB] Problem with php/mysql and ISS on windows XP profeesional
> >
> >
> > > hi
> > > i use php and mysql on IIS server on windows xp professional
> > > when i select anything from the database i get this :
> > > "Notice: Use of undefined constant name - assumed 'name' in
> > > d:\inetpub\wwwroot\EGYCDS\index.php on line 158
> > > Spy Hunter"
> > >
> > > while evrything is going fine when i upload it on the web and it returns
> > > only "Spy Hunter"
> > >
> > > i think  i have to disable this eroor message only
> > > can any one tell me how i disable that error message
> > >
> > > _
> > > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > >
> > > --
> > > 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
> >
> 
> _
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
> http://join.msn.com/?page=features/junkmail
-- 
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] Total Values with MySQL

2003-06-03 Thread Adam Voigt
SELECT SUM(ColumnName) AS total FROM table WHERE ColunName = '1';



On Mon, 2003-06-02 at 11:18, shaun wrote:
> Hi,
> 
> Is it possible to get MySQL to total the values of a select statement, say
> 'SELECT ColumnName FROM Table WHERE ColumnName = '1''
> 
> Say I have three values in ColumnName all of '1' then can I get MySQL to
> return 3?
> 
> Thanks for your help
-- 
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] Accessing MySql using Flash while using PHP as themiddleware

2003-06-25 Thread Adam Voigt
Might want to check out a article on devshed:

http://devshed.com/Client_Side/Flash/DataDrivenFlash/page1.html


On Wed, 2003-06-25 at 11:15, Ron Allen wrote:
> Does anybody have an idea how-to use Flash and PHP to access a MySql
> database. I know how to use PHP and mysql with no problem to pull info, but
> with Flash I am struggling.
-- 
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] moving though an array..

2003-06-26 Thread Adam Voigt
One Thing:

Change $columns[] to $colums, example:

$columns = explode(',',$threadsColumn);


On Thu, 2003-06-26 at 10:23, Aaron Wolski wrote:
> Hi All,
>  
> Hopefully someone here can point me in the right direction.
>  
> I need to create a SELECT statement based on some criteria select and
> entered into a form.
>  
> Form variables:
>  
> $threadsColumn = "manufactuer,colour";
> $string = "n";
>  
> Code:
>  
> $columns[] = explode(",",$threadsColumn);
>  
> $test = "(";
>  
> for ($i=0;$i  
> $test .= $columns[$i]." %$string%";
>  
> }
>  
> $test .= ")";
>  
> echo $test;
>  
> What I am attempting to do is create a select statement that would look
> like (based on "form variables"):
>  
> SELECT * FROM tablename WHERE (manufacturer LIKE %n% OR colour LIKE %n%)
>  
> The information between ( and ) needs to be written in such a manner
> that it scales up or down in options.. depending on what was selected in
> the form.
>  
> ANYONE have some thoughts?
>  
> Oh.. when I echo the above code I get this: (Array %h%)
>  
> Thanks!
>  
> Aaron 
>  
-- 
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] 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=someuser&pwd=somepwd;
> > 
> > and source will look like:
> >  > // 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 "Comments";
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

==

";
} //End While
} else {
echo "no comments";
}

//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 "::Warning::This 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 "$EventName - $EventDate 
Directory contains a total of ".count($images)." image files ";

echo "";

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

if($j == $num_prow){
echo "


";
if(in_array($images[$i],$result))echo "Comments";
echo "";
//
$j = 1;

}else{
echo "";
//
if(in_array($images[$i],$result))echo "Comments";//

$j++;

}
}
echo "";

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 "Previous";

for ($i = 1; $i <= $numPages; $i++) {
echo " | ";
if ($i == $page)
echo "$i";
else
echo "$i";
}

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 " | Next";
/*
if($i < $total){echo "Next";}
if($page != $total){echo " Last";}
*/
echo "";

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 "";
if ( !isset( $_SESSION['login'] ) ) {

echo "";
echo "Username:  Password:  ";
echo "Not A Member
Yet? ";
echo "";

 } else {
echo "Welcome $username    Logout   ";
}
echo "";
 }


[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
I'm doing a fulltext search.

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?

In the case of the latter, you'll have to split up the sentence into
individual words and look for each of them
WHERE column = 'holmes' || column = 'north' || column = 'carolina' ...

---John Holmes...
(not in North Carolina, btw!)
--
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] Re: [PHP] keyword searching

2003-11-12 Thread Adam Williams
I'm using Informix SQL.  Do you know how to do full text searching on 
Informix?  If so, please share the details :)

Jay Blanchard wrote:

[snip]
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?
[/snip]

You don't say which database you are using, but several allow for full
text searching of fields where the order is inconsequential. The
behaviour you describe is preceisely how most (if not all) databases
will return a search on a "standard" column type.
--
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] 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 kształty... 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 kształty... 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 kształty... http://www.opera.com 007

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



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

2004-01-02 Thread Adam i Agnieszka Gasiorowski FNORD

I need help width formulating the most
 effective (in terms of processing time) 
 SQL query to count all the "new"
 documents in the repository, where "new" is
 defined as "from 00:00:01 up to 23:59:59
 today". My current query does not give me
 satisfactory results, it creates a visible
 delay in rendering of the main page of one of
 the departments (Drugs) :8[[[
 (at least I, for now, think it's the culprit).
 It's for the https://hyperreal.info >
 site, see for yourself, notice the delay
 https://hyperreal.info/drugs/go.to/index >.

Currently I ask MySQL to (offending
 PHP fragment follows, I hope it is self-
 explanatory).



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 | smallint(6)  |  | MUL | 0 ||
| Priority | tinyint(4)   |  | | 3 ||
| Keywords | varchar(255) | YES  | | NULL  ||
| Sorting  | varchar(255) |  | | Priority DESC ||
| OrderBy  | varchar(255) | YES  | | NULL  ||
| SplitAt  | smallint(5) unsigned |  | | 25||
| Status   | int(16) unsigned |  | | 0 ||
+--+--+--+-+---++

Tell me if you need any additional information.
 Thank you for all your help.

MySQL version is 4.0.17, PLD Linux Distribution MySQL RPM.

-- 
Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
http://hyperreal.info  { iWanToDie }   WiNoNa)   (
http://szatanowskie-ladacznice.0-700.pl  foReVeR(  *  )
Poznaj jej zwiewne kształty... 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 kształty... http://www.opera.com 007

smime.p7s
Description: S/MIME Cryptographic Signature


<    1   2   3   4   >