RE: [PHP-DB] Resolution detect and redirect
BDY.RTF -- 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 with non-Character-fields with MSSQL70
Hi there, I can easily get results of my tables when i try to get character-type fields but when I try to get a numeric-type field i receive the following messages: Warning: Sybase: fieldname field not found in result in filename.php on line 32 Line32 tells me: $Var = mssql_result($res, $i; "fieldname"); Can anybody help me? Many thanks Martin -- 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] MySQL novice: database not updating ... LONG
Three things I see: 1. You seem to be assigning hard-coded values to u_mange_users, and "0" , as it is last, will always win. I think, I alsway have to mess with them a bit. That's why checking your SQL is important. 2. You are embedding a semi-colon in SQL statements. That's not necessary. 3. Have you echoed the SQL statement to see if it is what you expect? Add "echo $query;" to print the query out to your browser. If you can, check it at the MySQL command line. Hope this helps - Miles At 12:19 PM 2/28/01 +, V e r b a l wrote: I'm trying to modify a script I'm using. I've gotten so far that it displays my change and updates to old setting. I've added the required field in the database and all setting but my new addition are being updated. Anyone sees anything strange here, or failing that what should I look for in the code? V e r b a l 8 -- c o d e -8 Now, in the snippets I've included below. There are several more of these (input lines are on one line rather than broken like here): tr td width="50%" valign=center align=right font size=3Manage Users:/font /td ? if ($u_manage_users==1) { $manageusersgrant="checked"; } else { $manageusersdontgrant="checked"; } ? td width="25%" valign=center align=center input type="radio" name="u_manage_users" value="1" ?echo $manageusersgrant;? /td td width="25%" valign=center align=center input type="radio" name="u_manage_users" value="0" ?echo $manageusersdontgrant;? /td /tr // This is what I've included tr td width="50%" valign=center align=right font size=3Manage Clients:/font /td ? if ($u_manage_clients==1) { $manageclientsgrant="checked"; } else { $manageclientsdontgrant="checked"; } ? td width="25%" valign=center align=center input type="radio" name="u_manage_clients" value="1" ? echo $manageclientsgrant;? /td td width="25%" valign=center align=center input type="radio" name="u_manage_clients" value="0" ? echo $manageclientsdontgrant;? /td /tr // Ends my addition The update is (as I understand) called by this statement .. p align=center center input type="submit" value="Next " name="cmdSelectDepartments" /td /center And the routine called cmdSelectDepartments looks like this: if(isset($cmdSelectDepartments)) { $query = "UPDATE security SET "; $query .= "s_firstname='$txtFirstname', "; $query .= "s_lastname='$txtLastname', "; $query .= "s_password='$txtPassword', "; $query .= "s_email='$txtEmail' "; $query .= "WHERE s_user='$txtUsername';"; $mysql_result = mysql_query($query, $mysql_link); if ($mysql_result) { } $query = "UPDATE security SET "; $query .= "s_register_new_tickets='$u_register_new_tickets', "; $query .= "s_authorize_tickets='$u_authorize_tickets', "; $query .= "s_assign_tickets='$u_assign_tickets', "; $query .= "s_update_tickets='$u_update_tickets', "; $query .= "s_delete_tickets='$u_delete_tickets', "; $query .= "s_open_closed_tickets='$u_open_closed_tickets', "; $query .= "s_view_unauthorized_tickets='$u_view_unauthorized_tickets', "; $query .= "s_view_department_tickets='$u_view_department_tickets', "; $query .= "s_add_categories='$u_add_categories', "; $query .= "s_delete_categories='$u_delete_categories', "; $query .= "s_add_departments='$u_add_departments', "; $query .= "s_delete_departments='$u_delete_departments', "; $query .= "s_manage_users='$u_manage_users', "; $query .= "s_add_parts='$u_add_parts', "; $query .= "s_manage_clients='$u_manage_clients' "; //my addition $query .= "WHERE s_user='$txtUsername';"; $mysql_result = mysql_query($query, $mysql_link); As I said. All other settings are being updated, but mine (marked //my addition). -- 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] SQL STATEMENT?????
Hi! I am looking for a SQL Statement that would allow me to remove a column from the table in the database. Just give me what you know and I'll check out the SQL Reference I have for the database. Don't worry about what type of database do I have, that's what hte SQL Reference is for. (It came with this database software). Thanks, Scott -- 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]
AW: [PHP-DB] SQL STATEMENT?????
scott, try " alter table drop(column)" -u -Ursprngliche Nachricht- Von: Scott Fletcher [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 28. Februar 2001 14:50 An: [EMAIL PROTECTED] Betreff: [PHP-DB] SQL STATEMENT? Hi! I am looking for a SQL Statement that would allow me to remove a column from the table in the database. Just give me what you know and I'll check out the SQL Reference I have for the database. Don't worry about what type of database do I have, that's what hte SQL Reference is for. (It came with this database software). Thanks, Scott -- 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] SQL STATEMENT?????
alter table remove column_name Or something along those lines. Hope that helps a little bit. Wesley Choate Daymark Group Programmer / Web Developer Phone: (501)-968-4038 X2204 Email: [EMAIL PROTECTED] Web: www.daymarkgroup.com -Original Message- From: Scott Fletcher [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, February 28, 2001 7:50 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL STATEMENT? Hi! I am looking for a SQL Statement that would allow me to remove a column from the table in the database. Just give me what you know and I'll check out the SQL Reference I have for the database. Don't worry about what type of database do I have, that's what hte SQL Reference is for. (It came with this database software). Thanks, Scott -- 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] md5
I know there is an issue about encrypting an already encrypted string, or encrypting something twice. I believe it is against the law in the US for some algorithms (like MD5). They [they] have to be able to crack your stuff. Maybe someone can confirm? How does this relate to your problem? Well maybe md5 thinks your string has already been encrypted. Mike -Original Message- From: bryan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 27, 2001 4:48 PM To: Joe Brown; db Subject: Re: [PHP-DB] md5 Yeah, i am aware of the 32 byte character string. As a matter of fact, I md5 the password on initial sign-up. Then just compare it to the regular password. As for this case, I am trying to update the password that is already md5 'd in the database. The problem is, I am creating a random string (with letters and numbers) and making it 10 characters long. I think md5 has a problem with this, for some reason Probably just me though. Thanks for the advice. bryan - Original Message - From: "Joe Brown" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 27, 2001 12:40 PM Subject: Re: [PHP-DB] md5 You are aware that md5() generates a 32 byte character string? Working on the 10 digit password request, have you alotted enough space in your database columns to cater to a 32 byte string (64 for multibyte)? BTW: md5 has eaten everything I've thrown at it ;-) ""bryan"" [EMAIL PROTECTED] wrote in message 005801c0a0f1$c5c3cd40$272478cc@bryan">news:005801c0a0f1$c5c3cd40$272478cc@bryan... I need some advice on this I am creating a random password through a function. This creates a random password and updates it in the database. The sql query works if I make it : $sql = "UPDATE members SET password='$password', verify='$verify' WHERE username='$username' "; but if I make the code (as below) with the md5, it does not. I must be doing something wrong, or it does not like to md5 random things or something. Any Advice? for ( $a=0; $a1; $a++) { $password = newpwd( 10 ); $verify = $password; $dbcnx = mysql_connect('localhost', 'bryan', 'fitch'); mysql_select_db( "playtime" ); $sql = "UPDATE members SET password=' ".md5($password)." ', verify=' ".md5($verify)" ' WHERE username='$username' "; -- 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] Solid Database Installation
There have been a number of mails about the SQLParamData error when starting Apache after installing the solid database installation. Here is a list of the actions we had to take to get solid working correctly with PHP 4.04pl1 I hope it saves some time since it cost us a lot ! Solid version is the current linux version 3.5 with glibc2 In the include directlry of solid sqlunix.h change #include wcstr.h to #include stdlib.h Seems like the call to wcstr.h is an old call. The compilation will then work. In the solid lib directory make symlinks like this: ln s socl2x35.a libsocl2x35.a ln s socl2x35.so libsocl2x35.so The standard installation doesnt include these. Not 100% sure they are really needed but we got linker errors. Finally put the path to those libs in LD_LIBRARY_PATH or edit /etc/ld.so.conf (dont forget to run ldconfig after). Now the PHP problem. After solving these problems you get the SQLParamData error when loading apache. Seems like there is a script error in ./configure There is a test in this file for the existence of the solid files after which there are several echo statements if there is a problem (you can pretty much search for these in the file). On the last echo statement the "else" clause is on the same line and is ignored. Unfortunately the else clause contains the linker statements and is ignored. Hence the error. Putting the else on a new line fixes the problem. You can see if you have this problem when you run configure. You may get the message "Finding Solid Library ..." but no error and nothing after the dots. Hope this helps. David Foster ([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] Selecting number of news items on frontpage
I have a homepage which has a news headline system. Bascially via form the admin of the site can submit news which appears on the front page, the only problem is the news just keeps coming and I have a front page with too many headlines on. How can I make it so that say 7 articles appear on the front page and the rest can be accessed through some sort of archive? Perhaps a link underneath these articles to the archive? And the actual archive a page with the headlines listed that they can click on and view the story, the headlines listed in date order. How would I do this? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] Can't connect to local MySQL server error
Yep. This one got me. /var/lib/mysql had these permissions: drwx-- Changed to: drwx-r-x-r-x Worked like a charm. Many thanks to Joe and Rick rick -Original Message- From: Joe Brown [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 27, 2001 10:24 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Can't connect to local MySQL server error Heh, hate this gotcha... The file permissions are good... ok, now check each directory up to mysql.loc /var /var/lib /var/lib/mysql Does the world have read and execute perms on all of the above (hehe made a funny)? Without read and execute perms on the parent directories, the world cannot see the file to have read write and execute to the socket file. gl "Rick Emery" [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... MySQL is running; I can execute MySQL as ROOT. The /var/lib/mysql/mysql.sock file exists with read/write/execute permissions to user/group/world. Any other ideas are appreciated. Thanks rick Richard L. Emery IT Sr. Project Manager "There is no 'trying'... There is only 'Do' or 'Not Do' " -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 4:46 PM To: Rick Emery; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Can't connect to local MySQL server error Addressed to: Rick Emery [EMAIL PROTECTED] '[EMAIL PROTECTED]' ** Reply to note from Rick Emery [EMAIL PROTECTED] Mon, 26 Feb 2001 14:33:32 -0600 I tried: Grant ALL ON *.* to user@localhost IDENIFIED BY "password"; so as to provide access to all tables. I should have stated that the error I got was that I could not connect to the /var/lib/mysql/mysql.sock socket. Make sure that MySQL is running, that the mysql.sock file exitst, in the specified location, and that the permsiions on that file, and every directory above it allow the user the web server runs as has read and execute rights. Note that execute for directories means that you can cd to it, and has nothing about running programs from within it. If the file is missing, try to find it (locate) and look in php.ini for a setting to specify the correct location for your system. Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- 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] Selecting number of news items on frontpage
Hey, If you're using Mysql to store the items, you could use the Limit statement to limit the number of items displayed. If you're using the file system it'd probably be a little more difficult, but not impossible. For example, if the news items were stored in a text file with one entry per line, you could just use file() to convert the file to an array and then loop 7 times--grabbing the first 7 elements (or news items) of the array. Best Regards, Bill Zeller --- Matthew Cothier [EMAIL PROTECTED] wrote: I have a homepage which has a news headline system. Bascially via form the admin of the site can submit news which appears on the front page, the only problem is the news just keeps coming and I have a front page with too many headlines on. How can I make it so that say 7 articles appear on the front page and the rest can be accessed through some sort of archive? Perhaps a link underneath these articles to the archive? And the actual archive a page with the headlines listed that they can click on and view the story, the headlines listed in date order. How would I do this? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] __ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ -- 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] Selecting number of news items on frontpage
Matthew, Do you want to be told how, or want to read an interesting article on just this, including PHP script to build your archives. It's one of the early PHP tutorials -- try a search on "php movie database". I adapted code from that for my own archive, although I run a shell script, logged in as root, to actually make the directory and copy the files. That has mostly to do with security, although it could probably be overcome by having the archive directory owned by whatever name the webserver runs as. Miles PS Ah, just found it: http://www.webreview.com/pub/2000/02/11/php/index.html That will take you to their archive. Good luck!! PPS The shell script just prompts for a directory name and creates the directory, then copies all files from the web site root into the newly created directory. A second script publishes the new files. Have fun!!! At 04:13 PM 2/28/01 +, Matthew Cothier wrote: I have a homepage which has a news headline system. Bascially via form the admin of the site can submit news which appears on the front page, the only problem is the news just keeps coming and I have a front page with too many headlines on. How can I make it so that say 7 articles appear on the front page and the rest can be accessed through some sort of archive? Perhaps a link underneath these articles to the archive? And the actual archive a page with the headlines listed that they can click on and view the story, the headlines listed in date order. How would I do this? _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] php-db Digest 26 Feb 2001 19:12:23 -0000 Issue 477
php-db Digest 26 Feb 2001 19:12:23 - Issue 477 Topics (messages 6951 through 6963): Re: Server side or client side? 6951 by: Uioreanu Calin 6953 by: JJeffman Re: OCI 8 and rowid cause SIGSEGV 6952 by: Thies C. Arntzen Re: cookies, email and passwords 6954 by: JJeffman Re: Join causing Error? 6955 by: Johnny Withers Oracle 8i questions 6956 by: Chris Murtland 6958 by: Andreas Karajannis 6959 by: Joe Brown Re: Interbase + PHP 6957 by: Meir kriheli The dreaded 12154!! 6960 by: Kevin Porter 6962 by: Kevin Porter Updating a Grid of Data 6961 by: Chris Andrew Re: Can't connect to local MySQL server error 6963 by: Rick Emery Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- Hello, I see here a problem in jsclient-side generated code. Suppose 1st list (category) has 100 elements and second list, the products (ex.) has each 200 elements. a code that prevents selecting in 1st list the category would select all 100 x 200 elements and use js to display the correct list. This is very expensive. The link solution seems much better Regards, Uioreanu Calin That's what I've been telling to who asked about filling drop down lists at run time: When the amount of data is small you can generate JavaScript arrays to hold it otherwise you MUST reload the page to run your php script to fill up drop down lists. HTH. Jayme. -Mensagem Original- De: Uioreanu Calin [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 26 de fevereiro de 2001 06:54 Assunto: Re: [PHP-DB] Server side or client side? Hello, I see here a problem in jsclient-side generated code. Suppose 1st list (category) has 100 elements and second list, the products (ex.) has each 200 elements. a code that prevents selecting in 1st list the category would select all 100 x 200 elements and use js to display the correct list. This is very expensive. The link solution seems much better Regards, Uioreanu Calin -- 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] On Sat, Feb 24, 2001 at 05:43:58PM +0100, Sven Voigt wrote: On Friday 23 February 2001 17:03, you wrote: I suppose the authors never concieved a replacement parameter for select specification. try: $sql =3D "select foo, bar, rid from masterdata WHERE rid=3D:rid" You need to loose the colon ":" or place it to the right of a where cla use. Sorry to bother this list again, but I don't get the point... :-( I need the rowid for later updates by a user form. So how can I issue a select clause with 'WHERE rid=3D:rid'? Don't I need this for the *update* clause??? rowids in 8i are an opaque data-type. so you need to convert them to something human-readable 1st (btw the column is called rowid and not rid). select ROWIDTOCHAR(rowid), name from test; ROWID NAME -- AAAGBFAAIAAAB/tAAA mller update test set name = 'hallo' where ROWID ='AAAGBFAAIAAAB/tAAA'; This is what I thought of: 1.) select foo, bar, rid from masterdata 2.) let user select data set to update with 'update.php?rowid=ROWID' 3.) write changes to database: update foo, bar values (FOO, BAR) where rowid=ROWID' usually one uses his/her self-defined primary key for that purpose. And what's about that colon? Is there any special meaning in PHP? no - in oracle sql the colon indicate that you are using a placeholder (= bind-variable); I'd highly appreciate your help/answer! Many thanks in advance BTW i cannot reproduce the reported crash - could you please try the latest snapshot from snaps.php.net and report if you still see this crash? thanx, tc Have a look on PHP manual there is good information on mail functions, setcookie function, and other stuff. HTH Jayme. -Mensagem Original- De: Matthew Cothier [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: domingo, 25 de fevereiro de 2001 17:13 Assunto: [PHP-DB] cookies, email and passwords Thanks! Is there anyone who can actually give me little bits of code that I need cause I am in a rush with this _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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
[PHP-DB] php-db Digest 27 Feb 2001 08:38:46 -0000 Issue 478
php-db Digest 27 Feb 2001 08:38:46 - Issue 478 Topics (messages 6964 through 6974): dns script 6964 by: Liz Bander 6968 by: php3.developersdesk.com Re: Can't connect to local MySQL server error 6965 by: Brunner, Daniel 6967 by: Rick Emery Re: onMouseOver onMouseOut 6966 by: Ron Brogden 6969 by: php3.developersdesk.com Fatal error: Call to undefined function: () in add2.php on line 11 6970 by: jim and lois flaherty 6973 by: Joe Brown array awry 6971 by: Keith Spiller 6972 by: Rolf Hopkins 6974 by: CC Zona Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- I'm not sure that this is entirely on topic, but does anyone have a simple DNS script gleaning from MySQL 3.23 that I could take a look at? Right now we're doing the manual entry thing, but it's going to get old fast. If you can even direct me to an appropriate source, that would be great. Thanks, Liz Addressed to: Liz Bander [EMAIL PROTECTED] [EMAIL PROTECTED] ** Reply to note from Liz Bander [EMAIL PROTECTED] Mon, 26 Feb 2001 14:51:07 -0500 I'm not sure that this is entirely on topic, but does anyone have a simple DNS script gleaning from MySQL 3.23 that I could take a look at? Right now we're doing the manual entry thing, but it's going to get old fast. If you can even direct me to an appropriate source, that would be great. I don't understand what you want to do. Please give a few more details on what you want. This is probably as good a place as any for the question though. Rick Widmer Internet Marketing Specialists http://www.developersdesk.com Hello... Try this instead... Grant ALL ON Database_name.* to user@localhost IDENIFIED BY "password"; You can use Grant whatever ON Database_name.*...As well The .* after the Database_name will allow all tables to be accesed by the users, on that Database... It worked great for me... Dan -- From: Rick Emery Sent: Monday, February 26, 2001 1:16 PM To: '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] Can't connect to local MySQL server error I'm also having trouble connecting to the MySQL server. I can connect as root, but not as a user from the command line. When connect to the mysql server as ROOT, I've granted all privileges to the user using 'user@localhost' and 'user@"%" '. Still no luck. I'm using MySQL on Redhat Linux. I'm having same problem connecting via a mysql_connect(---) call in PHP. What do I need to do to allow user interaction for MySQL? thanks rick Richard L. Emery IT Sr. Project Manager "There is no 'trying'... There is only 'Do' or 'Not Do' " -Original Message- From: Brunner, Daniel [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 5:05 PM To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: RE: [PHP-DB] Can't connect to local MySQL server error Hello... Do a netstat -vatp To see if mysql is up and listening on your TCP. And it will give your PID/Program name as well... I remember reading something about if the mysql.sock didn't work...you needed to do something with mysql...I'll look into it this weekend. If nobody can help you out sooner Well good luck... Dan -- From: Chris Weiss Reply To: [EMAIL PROTECTED] Sent: Friday, February 16, 2001 4:37 PM To: [EMAIL PROTECTED] Subject:[PHP-DB] Can't connect to local MySQL server error Help! I'm experimenting with several of the PHP based WebDatabase front ends and am getting the following errors from all of them: "Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/httpd/html/pub/mainfile.php on line 9 Unable to select database" I've tried the following: [root@casadelove pub]# telnet localhost 3306 |strings Trying 127.0.0.1... Connected to casadelove.com. Escape character is '^]'. 3.23.27-beta $Gu=m/. Connection closed by foreign host. The databases being requested do exist and are populated with the default data and WebMin (Perl-based web administration program) accesses the test databases just fine. This is on a RH6.2 system with Apache 1.3.14 and PHP 4.0.4. This strikes me as something really stupid that I'm missing, anyone have any bright ideas where to look? -- 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:
Re: [PHP-DB] Selecting number of news items on frontpage
Matthew, My MySQL syntax is a little rusty. But if you define tables as type "MYISAM" and implement a primary key like this "nArticleKey integer unsigned not null auto_increment primary key" you will have a steadily incrementing count on your articles, as you add them, with no intervention. You could then issue as select statement like " select * from articles limit 7 order by nArticleKey descending" (maybe it should be "top" instead of "limit", check your MySLQ syntax) and feed those to the front page. Store your lowest of the retrieved article numbers, in $lownum, then for the archive, "select * from articles where nArticleKey $lownum descending". Wrangling the results out to the page, etc. I leave to you. Maybe you've done all of this already and I'm just wasting keystrokes? Let me know how it goes, I will go have a look at the page. Regards - Miles At 10:28 PM 2/28/01 +, Matthew Cothier wrote: From: [EMAIL PROTECTED] (Miles Thompson) To: [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: [PHP-DB] Selecting number of news items on frontpage Date: Wed, 28 Feb 2001 17:06:07 -0400 Matthew, Do you want to be told how, or want to read an interesting article on just this, including PHP script to build your archives. It's one of the early PHP tutorials -- try a search on "php movie database". I adapted code from that for my own archive, although I run a shell script, logged in as root, to actually make the directory and copy the files. That has mostly to do with security, although it could probably be overcome by having the archive directory owned by whatever name the webserver runs as. Miles PS Ah, just found it: http://www.webreview.com/pub/2000/02/11/php/index.html That will take you to their archive. Good luck!! PPS The shell script just prompts for a directory name and creates the directory, then copies all files from the web site root into the newly created directory. A second script publishes the new files. Have fun!!! Basically I am using PHP and MySql, is there no way of just grabbing the last 7 articles entered into the database and displaying them and then linking to a page with the rest of them (ie. All the others minus the last 7 - the ones on the front page)? What loop code would I need for this, its a friends site that I have just started : www.sunsetbeachuk.com Thats the url if it helps to take a look, as you will see the front page just grows and grows as more news is added _ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. -- 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] Selecting number of news items on frontpage
You could then issue as select statement like " select * from articles limit 7 order by nArticleKey descending" (maybe it should be "top" instead of "limit", check your MySLQ syntax) and feed those to the front page. select * from articles order by nArticleKey desc limit 7 although a better way would be to include a date stamp on the article (which i see you already have, and assuming you have done it in mysql friendly - "Y-m-d H:i:s" then you can do this and get them in reverse chronological order (newest article first) select * from articles order by date desc limit 7 and on the "archive page" select * from articles order by date desc limit ,7 or something like that, see the mysql documentation under the select syntax -- 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] Tricky database query involving two tables
I have a tricky database query I can't figure out how to write. I have a PHP app using MySQL that does a query like this: (main query) select * from A left join B on something where B.thing = "1" This gets me everything in A where its corresponding element in B has a certain attribute. What I want is to be able to now do this: select * from A where A not in the result set of the main query I can't just do: select * from A left join B on something where B.thing != "1" or B.thing is NULL because things in A might occur more than once in B, (or not at all in B, but that's covered by the NULL part), and so this query would return things in A that I already got in the main query. Is there a way to do this in MySQL? Or do I have to just query everything, and then have the skipping logic be in PHP? I'd love to encapsulate this in a query. Would it involve subqueries (something I know that MySQL doesn't directly support)? Let me know if I need to be more clear or specific in my question. Thanks! - Ken [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] Tricky database query involving two tables
At 09:50 PM 2/28/2001 -0500, you wrote: Is there a way to do this in MySQL? Or do I have to just query everything, and then have the skipping logic be in PHP? I'd love to encapsulate this in a query. Would it involve subqueries (something I know that MySQL doesn't directly support)? The part that seems to be missing here is that you are note limiting the relationships between table A and table B, you are just slapping them together. There should probably be a field that you use to lock rows together between the tables: select a.foo,b.bar from A left outer join B ON a.foo=b.foo where b.bar=1 If you have known relationship between the tables shared between the queries then selecting "b.bar!=1" should actually work. Hard to get real specific though without seeing a "real" query and table schema. Cheers - Island Net AMT Solutions Group Inc. Telephone: 250 383-0096 1412 Quadra Toll Free:1 800 331-3055 Victoria, B.C. Fax:250 383-6698 V8W 2L1 E-Mail:[EMAIL PROTECTED] Canada WWW: http://www.islandnet.com/ - -- 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]