Re: [PHP-DB] Debian & mssql_init

2005-01-28 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Robert Twitty wrote:

> The problem is caused by the fact that the sybase extension was installed
> instead of the mssql extension.  The sybase extension supports some of the
> mssql functions via aliasing. Unfortunately, mssql_init() is not supported
> by the sybase ext.  You basically have only 2 options:

> 1. Rebuild PHP with the mssql extension instead of the sybase extension.
> If you choose this option, you should upgrade to the latest versions of
> PHP and FreeTDS.

> 2. Build the shared version of the odbtp extension, which can be obtained
> at http://odbtp.sourceforge.net. This option does not require you to
> rebuild PHP.  However, you will not be able to use the mssql_* functions
> aliased by the odbtp ext because of namespace conflicts with the mssql_*
> functions aliased by the sybase ext.

> Unless you have existing scripts that use the mssql_* functions, option 2
> may be you best choice. It provides better support for SQL Server.

> -- bob

> On Wed, 14 Jul 2004, Damien Babilon wrote:

> > Hi everybody,
> >
> > I'm new to the list and new with php.
> >
> > I try to execute a stored procedure on a MSSQL server.
> > The web server is a Debian machine with:
> >
> > php4   4.1.2-6woody3
> > php4-sybase4.1.2-6woody3
> > freetds0   0.53-7
> >
> > the mssql_connect function work right, but php give me back this message
when I try mssql_init:
> > Fatal error: Call to undefined function: mssql_init() in
/var/www/eurogsmtest/test.php on line XX
> >
> > I searched on google, but did'n find anything, the I try this ML for last
issue.
> >
> > Can anyone help me please?
> >
> > Best regards,
> >
> > Damien
> >
> >
> >
> >
> > 
> > Sent via the WebMail system at nethings.net
> >
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

Hi Robert,

I am having the same problem on FreeBSD. Unfortunately, it seems that PHP
version 4 is not supporting mssql_init() and mssql_execute(). I am going
to upgrade to php 5, may be it's gonna work.

Regards,
Joss

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



Re: [PHP-DB] Mozilla inserts twice, IE does OK... ?

2005-01-25 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Another dimension to the problem --- I am running my code on two separate
machines (Desk top & a laptop) the desktop (faster?) has this problem,
notebook (slower?) doesn't. I have code that checks for duplicate inserts
and warns user. Even this fails and the database ends up with two
identical records..

Has any one faced and solved this?

Shri


Steven wrote:

> Hi all

> Note in the source that in the MySQL Insert query "VALUES" starts at a new
> line.

> I put a DELETE command right after the INSERT command, to temporary catch
> the double line.  When I did that, I placed the "VALUES..."-part on the
> same line as the first part of the query and the double inserts
> disappeared.  (ofcourse)

> Weird is:  I removed the DELETE-command, and placed the VALUES-part on
> another line again, and the data is still inserted once in the table.

> Very strange, but I hope putting all of the query on a single line is a
> possible solution for this weird behavior :-)

> Anyone has any idea about this ?


> Steven


> > I'm not using the browsers 'view source' at all...  Only the 'view source'
> > function from PHP.
> > But when none of the source is checked, and even right after a restart of
> > MySQL and Apache, the dual insert resists...
> >
> > Funny thing is, I've had this problem in another section of the site, and
> > it
> > disappeared without any known cause.
> > And not to forget: problem doesn't appear in IE6, only in Mozilla and
> > firefox running on WinXP and Gnome2.
> >
> >
> > The code:
> > The file is called shop.php, and contains different functions indicated by
> > a
> > query-string value and separated by a Switch-structure.
> > I post the global code and the section for saving this data into MySQL.
> > If
> > you need the other code, please ask me
> > (I'm trying to avoid that for mailing too much code at once...)
> >
> >  > require ("classes/class_shops.php");
> > $shop = new shop;
> >
> > $dbconn=mysql_pconnect("localhost", "steven", "steven") or die
> > (mysql_error());
> > mysql_select_db("steven");
> >
> >
> > function pageheader () {
> > echo "SHOPS";
> > }
> >
> > $id = $_GET["id"];
> > $shopmode = $_GET["shopmode"];
> >
> > pageheader();
> >
> > switch ($shopmode) {   //shop, cat, item, reg, verify, save,
> > default
> > case "shop":
> > ...
> > case "cat":
> > ...
> > case "item":
> > ...
> > case "reg":
> > ...
> > case "verify":
> > ...
> > case "save":
> > echo "SAVE";
> > $name = $_POST["name"];
> > $logo = $_POST["logo"];
> > $logoname = $_POST["logoname"];
> > $address = $_POST["address"];
> > $pcode = $_POST["pcode"];
> > $location = $_POST["location"];
> > $area = $_POST["area"];
> > $phone = $_POST["phone"];
> > $email = $_POST["email"];
> >
> > //THIS is code that inserts an already uploaded
> > image in a separate table, and returns the ID
> > if ($logoname!="" && $logo!="") {
> > require ("classes/class_image.php");
> > $img = new image;
> > $upload = $img->image_upload($logo,
> > $logoname);
> > $logoID = $upload[2];
> > } else {
> > $logoID="";
> > }
> >
> > mysql_query ("INSERT INTO shop (name, logo,
> > address, pcode, location, area, phone, email, dateadded)
> > VALUES ('$name', '$logoID',
> > '$address', '$pcode', '$location', '$area', '$phone', '$email', '" .
> > microtime() . "');", $dbconn) or die("ikke: " . mysql_error());
> > echo "Uw gegevens werden bewaard!  Klik  > href=>hier om terug te gaan";
> > //translated: Your data has been saved!
> > break;
> > case default:
> > ...
> > }
> > ?>
> >
> >
> >
> > -Original Message-
> > From: Norland, Martin [mailto:[EMAIL PROTECTED]
> > Sent: maandag 6 december 2004 15:53
> > To: php-db@lists.php.net
> > Subject: RE: [PHP-DB] Mozilla inserts twice, IE does OK... ?
> >
> > Are you using view source a lot?  (some of) Mozillas view source
> > commands send the query again, minus the POST vars.  This could be the
> > behaviour you're seeing.
> >
> > I say some of because there are multiple ways of viewi

[PHP-DB] Double Inserts

2005-01-25 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi, I am new to the mailing list and to PHP / MySQL. I am facing an
unususal problem. I am trying to insert some data into MySQL DB through
via Web. The code is executed OK - no errors but the same record gets
inserted TWICE. I have checked the code and simplified it as much as
possible and tried test scripts with same results. I have also tried
statements to echo messages to ensure the code is not executed twice. 

It happens with IE as wells as Mozilla so I don't think it is a browser
issue. The only clue is that it does not seem to happen on a slower
machine (Laptop). The configurations, versions etc are identical - Apache
2.0.49, MySQL 4.1.6-gamma-nt, PHP 5.0.2

Has anyone faced this and found a solution? Please help.

Shri

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



[PHP-DB] Re: SQL statement syntaxis

2005-01-07 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody,
I just want to thank you all for your help!!
I got three emails helping me out. The problem was that I wasn't including
the ' around the ".
When I typed '".$_POST['CompanyName']."' it worked great!

Thank you!!
Jorge

PHPDiscuss - PHP Newsgroups and mailing lists wrote:

> Hello everybody,
> I'm building a small application and I have trouble passing a POST
> variable form one page to another inside the SQL statement.

> The query (displayed below) works great without the
> ".$_POST['CompanyName']." 

> $query_company_listing = "SELECT CompanyID, CompanyName,
> CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
> company WHERE company.CompanyName=".$_POST['CompanyName']."  ORDER BY
> CompanyName ASC";

> But it messes up if I include it because the first " is considered as the
> end of the previous one and so on. So the code gets messed up.

> Any help will be greatly appreciated!
> Have everybody a wonderful 2005!
> Jorge

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



[PHP-DB] SQL statement

2005-01-06 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.

The query displayed below works great without the
".$_POST['CompanyName']." 

$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.CompanyName=".$_POST['CompanyName']."  ORDER BY
CompanyName ASC";

But it messes up if I include it because the first " is considered as the
end of the previous one and so on, so the code gets messed up.

I'll really appreciate any/all help!
Have you all an excellent year!
Jorge

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



[PHP-DB] SQL statement syntaxis

2005-01-06 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.

The query (displayed below) works great without the
".$_POST['CompanyName']." 

$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.CompanyName=".$_POST['CompanyName']."  ORDER BY
CompanyName ASC";

But it messes up if I include it because the first " is considered as the
end of the previous one and so on. So the code gets messed up.

Any help will be greatly appreciated!
Have everybody a wonderful 2005!
Jorge

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



[PHP-DB] SQL statement syntaxis

2005-01-06 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello everybody,
I'm building a small application and I have trouble passing a POST
variable form one page to another inside the SQL statement.

The query (displayed below) works great without the
".$_POST['CompanyName']." 

$query_company_listing = "SELECT CompanyID, CompanyName,
CompanyOrDepartment, BillingAddress, City, PostalCode, PhoneNumber FROM
company WHERE company.CompanyName=".$_POST['CompanyName']."  ORDER BY
CompanyName ASC";

But it messes up if I include it because the first " is considered as the
end of the previous one and so on. So the code gets messed up.

Any help will be greatly appreciated!
Have everybody a wonderful 2005!
Jorge

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



[PHP-DB] MYSQL Maximum Time Exceeded

2004-12-15 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi.

I am running MySQL 4.0 and PHP 4.3.9 (MySQL Client Version 3.9.23) in
Windows XP.  I get this error when I try to connect to mysql:

Fatal error: Maximum execution time of 60 seconds exceeded in
c:\inetpub\wwwroot\index.php on line 4

My PHP script is:







I also tried installing newer PHP versios and newer MySQL but it's the
same.  Can anybody help me, please ?  Is WinXP incomaptible with MySQL or
what ?

Thanks in advance.

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


[PHP-DB] PHP-HTML-select deny

2004-12-01 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi, what can i do, where users can't select and copy my text from web-page.
Thanks

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



Re: [PHP-DB] Call to undefined function mysql_connect()

2004-08-01 Thread PHPDiscuss - PHP Newsgroups and mailing lists
I agree to you as my phpinfo does not show mysql at all. can you help me
as in how do i get the mysql support for the same, im using PHP/MYSQL on
windows 2000

Thanks


Larry E . Ullman wrote:

> > But i received "Call to undefined function mysql_connect() on line 5"
> >
> > Can anyone help me?

> Your PHP installation apparently does not support MySQL. You can 
> confirm this by running a phpinfo() script. You may need to 
> reinstall/recompile PHP.

> Larry

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



[PHP-DB] writing to 2 tables

2004-07-19 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi all,

I am writing a PHP newsletter where users are able to write the news and
for the information to be written to 2 tables in the database. I can do
this for one table but it need it for 2.

Obviously what needs to happen if that the two ids from t1 and t2 be
linked together but how do i get the code to tell it to write to both
tables using the same id??

Does anyone know how this would be done? 

All comments appreciated!
=)

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



[PHP-DB] Re: MySQL executes several times the same request

2004-06-29 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Justin Patrin wrote:

> Loïc moisy wrote:

> > Hi Everyone !
> > 
> > I've coded a php site for a musical store. At the end of every page, before
> > closing the connection, I send an UPDATE request to increment a statistical
> > tool. Recently I saw weird results, so I tried to understand. Looking in my
> > logs, I saw that this request could be sent several times, arbitrary - can
> > be 5 times or 8 or whatever... So my counter is incremented from 4 to 8
> > times. The server seems to resend the whole requestes several times. I have
> > read all of my scripts, even coded some trace code, and sure there is no
> > loop.
> > 
> > The code seems like that:
> > 
> > $counter++;
> > $SQL = "UPDATE statistics SET VALUE (`counter` = $counter)"
> > $res = mysql_query($SQL);
> > mysql_closedb($DB);
> > 
> > So, I do not see anything strange. Can u help me ? My own thought about it
> > is something like a buffer not empty or something like that.
> > 
> > Thanks !

> We had a problem like this on our site for a while. It turned out that 
> soneone had put an empty image tag on the site which was causing the 
> browser to go to the same page *again*. Check to make sure that all of 
> your images have the src attribute filled out.


Thanks for your answer ! I am just back now because I think the solution
can help someone. In my case, in fact, your answer let me work around and
look if something could occurs in this special case but not. In fact, the
problem come from the browser, but the several calls to the server is not
coming from an empty src tag, but from a golive script: the template of
the site use them, and one preload several pages I think, and so the
counter is increased several times...
Many thanks.

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



[PHP-DB] MySql syntax error using PHPWiki

2004-06-10 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Greetings,

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

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

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

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

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

Any help is appreciated.

James.

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



[PHP-DB] Re: Create subdomain using php in a linux machine

2004-05-31 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Dhanya philip wrote:

> Hi,
> I like to know how to create subdomain using php in a linux machine.

> Thank You

> Dhanya

> Yahoo! India Matrimony: Find your partner online.


Did you ever find a solution for this problem??  I'm interested in doing
the same.

JG

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



[PHP-DB] Re: Slow php-mysql

2004-05-19 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi Dez,

I think I got exactly the same problem. I have W2003 Advanced Server
running with IIS 6 and PHP 4.3.4. On a nother machine I have MySQL
4.1.0-alpha-nt. Now any connection from any other host in the network
(e.g. running phpMyAdmin) to the DB works just fine (hosts running IIS or
Apache). But from this one IIS server it takes about 7 seconds to come up
with the first connection. every other following connection in the same
script works just fine and fast. Except if I use the "new connection" flag
in the mysql_connect, then it takes 7 seconds per query. 

This is almost driving me nuts, as I just don`t know where to look
anymore! Have you found a solution?


Drez wrote:

> Hi all,
> I recently change my apche, php mysql server for a better one. I 
> installed all the same versions of software on the new server (except 
> for php which was 4.36 RC2). I have apache 1.3 + mysql 3.23.58 + php 
> 4.36. Im on a WinXp Pro os. I copy the exact config for the my.ini, 
> httpd.conf and php.ini files. The result is unfortunatly a very slow 
> application.
> For exemple, it takes 5-10 secoonds to phpMyAdmin to load after the 
> login, but when a do a big query, with the query interface, it clocks 
> under 1 second.
> I thought It was the php then, but a big while loop took not much time 
> then normal to print out.
> Then maybe the apache, but page containing only HTML print well.
> I try to put a connection and disconnection in the While loop and it 
> slow down all the process.
> With this little test I thing that it come from MySql. I try some 
> setting like "output_buffering" without result.
> If someone can help me identify for sure the guilty process with some 
> test a can't imagine myself
> Thanks, and sorry for my bad english I do my best!
> Drez

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



[PHP-DB] upload files into MySQL database

2004-05-11 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello,

I have problem for downloading files from MySQL database.
Although I store and I see the filename and the extension in the database,
when I try to download it, if there are blank spaces inside the filename,
like "my book store.doc"
I cannot open it and see it.

Best regards
Stelios Karapas

email: [EMAIL PROTECTED]

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



[PHP-DB] Dynamic Email Address in an HTML table

2004-05-09 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello,
I have a page displaying the results of a query from a mysql database.
The final field displayed is an email address (in text datatype from the
table).
How can I create the email address in the field as a hyperlink to the
email address? Since my query loops through the database and displayes a
"row" per row in the db.

EX:
Field 1  Field 2EmailAddress
Test Test   [EMAIL PROTECTED]

In the email address field, the address shows up as text, how can I create
that as a mailto:[EMAIL PROTECTED] (or whatever the email address is).

Thank you
Terry

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



Re: [PHP-DB] Image / file uploader

2004-05-06 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Try using the following:

$_SERVER[PHP_SELF]

Mainly, get rid of the quotes inside the brackets. Usually this error
'T_String' generally occurs when you have quotes (" or ') where they
shouldn`t be.

Give it a try if that thing still troubles you...
Good luck




Craig Hoffman wrote:

> Sorry to be a pest but I tried that.  It giving me the same error.
> __
> Craig Hoffman - eClimb Media

> v: (847) 644 - 8914
> f: (847) 866 - 1946
> e: [EMAIL PROTECTED]
> w: www.eclimbmedia.com
> _
> On Apr 29, 2004, at 7:10 PM, Daniel Clark wrote:

> > Change to double quotes for the HTML portion.
> >
> > action="$_SERVER['PHP_SELF']"
> >
> >> When I put single quotes in the PHP_SELF and I get this error:
> >> Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE,
> >> expecting T_STRING or T_VARIABLE or T_NUM_STRING
> >>
> >> and I can't use double quotes because its in an echo statement.  What
> >> am I missing?
> >> echo (" >> encType='multipart/form-data'>
> >>
> >> Any more thoughts?
> >> CH

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



[PHP-DB] PHP / mysql / opendb / Apache

2004-02-10 Thread PHPDiscuss - PHP Newsgroups and mailing lists
I am trying to get a functioning instance of these components working on
my Solaris 2.8 box.

Are there any comprehensive instructions out there to achieve this?

Thanks

Terry

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