Re: [PHP-DB] PHP4 LDAP
On Wednesday 20 March 2002 17:15, David Christensen wrote: The problem arises when I try to read back all of the attributes within the PHP script. I can see only certain attributes: uid, mail, cn (the normal stuff) but if I try to read these fields that I want to use for the session, they don't print in PHP, but the show up from the LDAP command line util. The fields include: employeeNumber, carLicense, departmentNumber. Like I said earlier, I can update them from PHP, just can't read them back. Try accessing them in lowercase ie. employeenumber There's a note on the ldap man page, it's not very clear but it helped me get at the stuff I needed. matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Need smoe code examples on creating tables for mysql in php
Need some code examples on creating tables for mysql in php can any one help me on this . I searched the php.net site and only found info on creating a database I just want to create a php script that will make 2 tables with lets say 5 fields each in them. Hi Maybe you wanna head on over to mysql.com and read the docs over there. This will give you the info you need on working with mysql. also try phpbuilder.com and devshed.com m: -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] phpMyAdmin Problem....
I just added phpMyAdmin to a new Apache Server, and I'm getting this error: cannot load MySQL extension, please check PHP Configuration. I did some research on the web, but couldn't come up with a solution to this error and couldn't find anyone listing it. Does anyone know if this is a problem with conf.inc.php in phpMyAdmin or with the MySQL set up in PHP on the server? Any suggestions from there? Sound like you need to recompile with mysql support. check phpinfo() to see if mysql is missing. m: -- 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] Problem with SQL query on several tables
Thanks, but I want wo JOIN data from three tables and then to order all data by datestamp. There must be more than one column called datestamp, this is why mysql is telling you it's ambiguous. So you need to tell it which table's datestamp column you wish to use. for example your new query could be: select * from f1,f2,f3 order by f1.datestamp Also, presumably all the tables have a column which relates to one of the other columns in some way? If so, and I can't reason the point in doing it if there is not, maybe you should look at the JOIN syntax from the mysql manual. If nothing else it will give you a better understanding of joining tables and the problems you may face. M: Can I Do It ? Thanks, Rosen Andrey Hristov wrote in message 071401c17759$f5873c80$0b01a8c0@ANDreY... Mysql says that in the join there are some columns with namer datestamp so you have to choose by which you want to order. Think about making LEFT JOIN. select * from f1 LEFT JOIN f2 ON f1.some_field=f2.some_field LEFT JOIN f3 ON f2.some_field=f3.some_field roder by f1.datestamp; Regards, Andrey Hristov IcyGEN Corporation http://www.icygen.com BALANCED SOLUTIONS - Original Message - From: Rosen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 5:34 PM Subject: [PHP-DB] Problem with SQL query on several tables Hi, I'm trying to execute SQL query: select * from f1,f2,f3 order by datestamp MySQL returns me an error: 1052 - Column: 'datestamp' in order clause is ambigious The tables f1,f2,f3 have some structure. The field datestamp is type datetime. Why I can't order query on 'datestamp' ? Thanks, Rosen -- 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 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] Query help
This doesn't work either. SELECT count(freerooms.room), WEEK(MAX(booking.date),1), WEEK(MIN(booking.date),1) as total FROM freerooms LEFT JOIN booking USING(room); All good so far now if I run this SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero oms f, booking b; -+---+-+-+ | count(f.room) | WEEK(MAX(b.date),1) | WEEK(MIN(b.date),1) | +---+-+-+ | 24817 | 48 | 40 | +---+-+-+ What I have found is freerooms.room has 83 rows and booking has 299. The value returned for count(f.room) is these two figures multiplied.??? Why would it do this? And how can I get it to return the real value only Regards M: -- 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] PHP results bold in HTML
$result = mysql_query($query); $num_rows = mysql_num_rows($result); if ($num_rows != 0) { print table class=\db1\ tr td width=\60\/th td width=\135\bClass/b/th td width=\135\bName/b/th td width=\135\bType/b/th td width=\135\bNPC/b/th /tr; while ($row = mysql_fetch_array($result)) { $name = $row[SimName]; $class = $row[SimClass]; $type = $row[ClassType]; $NPC= $row[SimNPC]; if ($NPC == 1) { echo tr td/th td$class/th td$name/th td$type/th tdNON PLAYING SIM/th /tr\n; } else { echo tr td/th tdclass/h3/th td$name/h3/th td$type/h3/th tdACTIVE SIM/h3/th /tr\n; } }; } First things first go through your html and clean up man. This is seriously bad... Don't close td with /th, mkae sure you tags are closed ie /th no opening tags for /h3 Then try again M: -- 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] Query help
Not really this list but I'm after a quick bit of help. If I run this query select count(room) from freerooms; -83 and this SELECT WEEK(MAX(date),1), WEEK(MIN(date),1)as totalweeks FROM booking; -4840 All good so far now if I run this SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero oms f, booking b; -+---+-+-+ | count(f.room) | WEEK(MAX(b.date),1) | WEEK(MIN(b.date),1) | +---+-+-+ | 24817 | 48 | 40 | +---+-+-+ It seems to be mulitplying out for some reason but I'm stuck as to how/why and how to resolve it. TIA M: -- 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] Cant connect to a remote mySQL database
Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in /usr/local/apache/htdocs/pruebamysql.php on line 5 Warning: MySQL Connection Failed: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) in /usr/local/apache/htdocs/pruebamysql.php on line 5 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO) And here it is the php.. wher it says localhost, I should only type the remote IP address? HTMLHEADTITLEForm Results /TITLE BODY ?php $connection = mysql_connect('localhost,'root'); if ($connection == false){ echo mysql_errno().: .mysql_error().BR; exit; } you need to supply the host address (name or ip), your username and password. look here for more www.php.net/mysql_connect M: -- 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] Problem compiling pgsql and php (Semi OT)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all I'm trying to add support for pgsql to my current setup. Everything (php 4.0.4, pgsql 7.1.1, apache 1.3.19) is compiled from source. Postgres is working fine on its own. Postgres is installed to /usr/local/pgsql I've tried compiling with - --with-pgsql - --with-pgsql=/usr/local/pgsql but each time I get the same error when I run make. The error is php_pgsql.h:32 postgres.h No such file or directory make[3]: *** [pgsql.lo]Error 1 make[3]: Leaving current directory '/usr/local/src/php-4.0.4pl1/ext/pgsql' I seem to remember when I install postgres onto nother machine using RPM I had to add pgsql_devel but I don't know to do this compiling postgres from source. Trawling through the manual and archives has sofar proved fruitless. Any help will be gratefully appreciated TIA M@ -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBO2bJ/qW0/zC+QxWwEQIkXACfXt7RAVI1JMkt5I3K01b+pur3cLkAoLZt CacpMr4hD8IO+UpXwEYNamSf =VZof -END PGP SIGNATURE- -- 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] PASSWORD('xxxxx') and PHP
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is there a way to encode a string in PHP exactly like MySQL does it in its PASSWORD() Function? Reason being Is I have a table with PASSWORD() encoded fields that I need to compare from PHP. just include PASSWORD() in your query ie. SELECT * FROM wherever WHERE password_field=PASSWORD('secretpassword') HTH M@ -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBO1fywqW0/zC+QxWwEQJyYACgjjRSID3QJimCM/yjCiEW+jMbR3EAn1OV gr7RzYMqC766L7q92EopaEIp =G01U -END PGP SIGNATURE- -- 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] submitbutton/imagebutton
I'm kind of new to php so there may be an obvious answer but I can't find it for the moment. What I want to do is change the 'type=submit' of a submit button to 'type=image' so I can control the looks of the button. In pure HTML there is of course no problem, the image is still used as a submit button but... the submit type is being passed on to a php script ( ...if ($submit) {...) that makes a qeary to a mysql database. When I change the type=submit to type=image the script doesn't pick up the submit value anymore, so nothing happens. Am I overlooking something or is it just something that doesn't work? IIRC you have to use something like $submit_x $submit_y, which is a bit more longwinded. Since I have started using buttons for submit, I now put a hidden field called formname inside each form,and chekc for that and that the method of the form is correct. It makes it a little bit easier if you have more than one form per page. HTH M@ -- 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] Stupid question
So, you would do: ? if ($x == 'CHECKED') { echo Is Checked; } else { echo Isn\'t Checked; }; ? Or (isset($x)) ? Is Checked : Not Checked; M@ -- 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] php notepad
UltraEdit www.ultraedit.com cool software Agreed, or HTML edit if you're looking for something free. M@ -- 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] Forms : Validating user input is integer
or even just elseif (!eregi("[^a-zA-Z]"),$num)) { } But that would not stop other characters. M@ -- 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] Forms : Validating user input is integer
Whoops! Careless of me. The line should read, and as I tested it, elseif (eregi("[a-zA-Z]",$num)) { } Do you see any problem with this? Yes, same thing it will accept other character like !*- etc... try if(!eregi("^[0-9]+[0-9]*$",$num) { //error } M@ -- 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] php.net website down?
Off subject but anyone know why php.net is down?? no but uk.php.net is up if that's any good to you. M@ -- 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] ALTER TABLE - code not working.
-Original Message- From: Martin E. Koss [mailto:[EMAIL PROTECTED]] Sent: 29 March 2001 15:32 To: Manuel Lemos; [EMAIL PROTECTED] Subject: RE: [PHP-DB] ALTER TABLE - code not working. $AddColQuery = "ALTER TABLE vips ADD COLUMN $NewCol"; $result = mysql_query ($AddColQuery,$conID); // now set the default value for all rows in vips table $SetDefault = "UPDATE TABLE vips SET $NewCol=$defaultvalue"; $result = mysql_query ($SetDefault,$conID); I believe you SQL is wrong, you forgot to set the column type. ie. ALTER TABLE vips ADD COLUMN $NewCol VARCHAR(32) etc M@ -- 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] Line Breaks
nl2br() -Original Message- From: Shope, Glenn [mailto:[EMAIL PROTECTED]] Sent: 23 March 2001 20:49 To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Line Breaks Still haven't figured it out... I have read several entries about preserving line breaks when displaying text from a mySQL database, but I have had no success. How would I prevent data in a single field containing line breaks from being displayed in HTML as a single line? For example: A person fills out a form with this information: "My name is Chris. I like to swim." Ho do I prevent PHP from writing it as "My name is ChrisI like to swim." ??? I have tried a EREG_REPLACE and PREG_REPLACE attempting to replace "\n" with BR, but it doesn't seem to do the trick. Any help would be greatly appreciated!! Glenn :) -- 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] cookies, email and passwords
Sorry for putting three topics in one but they all go together so I thought I would. I am setting up a user login/members area! * Firstly how do I generate a random password? * Then how do I email it to the user? * And now I need to know how to set a cookie with their username and password so that when they log in they don't have to keep entering their username and password for the hour that the cookie is active? * How do I also call the cookie into each page? If anyone can help with any of these I would be really grateful! Hi have a look at phplib http://phplib.netuse.de It may be a bit more than you need but it's good M@ -- 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] Here you have, ;o)
fantastic I never knew how to unsubscribe. M@ -Original Message- From: ajay arora [mailto:[EMAIL PROTECTED]] Sent: 12 February 2001 17:21 To: php db Subject: [PHP-DB] Here you have, ;o) Hi: Check This! -- 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] Dreamweaver rant OT was(RE: [PHP-DB] Can you recommend a development tool?)
Dreamweaver 4, now has the ability to display both the WYSIWYG GUI and the source-code in the same window, I like that as you can see what DW is doing as you place objects etc into the WYSIWYG section. whimper I don't like the fact that they changed all the keyboard shorcuts around F8 behaviours, F6 library etc - sadly no longer.. /whimper Why do they do this. They've done it with every new version. As though not confusing enough learning the new stuff,you have to relearn the old stuff. I especially don't like having to press Ctrl + A 10 times trying to select the whole table. And this doesn't always work with nested tables. g M@ -- 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]