Re: [PHP-DB] Refresh
I don't know Postgresql, but all databases I've dealt with increments auto-increment fields only on committing insert commands. I think you can catch the last id number (MySQL do it) and show the number + 1 on the user screen. HTH Jayme. -Mensagem Original- De: Julio Cuz, Jr. [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 27 de maro de 2001 16:51 Assunto: [PHP-DB] Refresh Hi-- I don't know if this is something PHP can solve, or if my database engine (Postgresql 7.03) needs to do something. Every time a user adds a new request, a new ID is generated, but SOMETIMES, when the same user adds several requests, one after another, the browser does NOT refresh and it displays the previous ID. For example: User A submits a new request (#1001), then adds another one (#1002), it should display #1002, but instead it displays #1001. Any ideas? -- 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] problem with writing date/time into db
You've misplaced a "$date" variable instead of $datum, $date has no value . HTH Jayme. -Mensagem Original- De: Florian Poppele [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: domingo, 25 de maro de 2001 10:26 Assunto: [PHP-DB] problem with writing date/time into db Just started with PHP. I'm trying to write a news post script. Somehow den actual date isn't written properly into the db. There's always '-00-00 00:00:00' saved into the db. my code: $datum = date("Y-m-d H:m:s"); $sql = "INSERT INTO news (datum,tag,text,autor) VALUES ('$date','$tag','$text', '$autor')"; If anyone can help, i'd be happy. Thanks. -- 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] file name extentions
Look for "AddType application/x-httpd-php4" on your Apache configuration file and add the types you want PHP4 be responsible for. Here are my own : AddType application/x-httpd-php4 .php AddType application/x-httpd-php4 .php3 AddType application/x-httpd-php4 .html HTH Jayme. -Mensagem Original- De: Dan Eskildsen [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sbado, 24 de maro de 2001 08:40 Assunto: [PHP-DB] file name extentions Hi there, Currently my ISP has PHP 3 installed and to run php scripts I have to save the file as name.php3 I expect to install my own server and php4 in the foreseeable future - how can I save the files as .php so that they are upwardly compatible? I have tired using the filenmae file.php but the server will not execute the file. Any suggestions? Regards, Dan -- == Regards from Denmark, Europe Please cc your reply to [EMAIL PROTECTED] == I haven't lost my mind, I've got it backed up on TAPE somewhere... -- 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] comparison table script
Remember it only works on PHP4.0 ! HTH. Jayme. -Mensagem Original- De: olinux [EMAIL PROTECTED] Para: PHP-DB [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 23:38 Assunto: Re: [PHP-DB] comparison table script Cool! Just came across this, looks like PHP will make life simple. http://www.php.net/manual/en/function.array-flip.php Array_flip() returns an array in flip order. Example 1. Array_flip() example $trans = array_flip ($trans); $original = strtr ($str, $trans); example: $a[0]="abc"; $a[1]="def"; After an array_flip() you get: $a["abc"]=0; $a["def"]=1; gotta love it! olinux De: olinux [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 12:37 Assunto: Re: [PHP-DB] comparison table script You can get an idea here of what I would like to do http://www.bestbuy.com/ComputersPeripherals/DrivesStorage/CDRW.asp?m=488cat =511scat=514 So all information is displayed side by side, most of the time used to help decide between 2 or 3 products [bestbuy limits 10 selections in their comparison] _ Do You Yahoo!? Get your free @yahoo.com address at http://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] -- 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] connection id
Use persistent connections it's a matter of performance of your script. When you use persistent connections the next call to mysql_pconnect will catch a opened connection if available. The mysql_connect command always open a new connection which slower than get an opened one. Anyway you can't use the connection_id in other page. May be using PHP4 Sessions. HTH. Jayme. -Mensagem Original- De: andrie [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 20:38 Assunto: [PHP-DB] connection id Hello php mania, i was connecting into mysql using mysql_connect, and i just saved the return value from this funtion. now i want to use this connection id in the other page so i dont have to connect into mysql again. is it possible for me to do that ? anybody could tell me the different between persistence connection or not ? and how the implementation ? TIA -- Best regards, andrie mailto:[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] Going bonkers again ...
A good advice is put an error checker after every mysql command, this way you can track errors : ?php file://view jobs script include("../includes/connect.inc.php"); file://connect to the database $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id = '$m_id'"; $result = mysql_query($query , $mysql_link) or die (mysql_error()); $summary = mysql_fetch_row($result) or die (mysql_error()); $m_sender = $summary[0]; $m_date = $summary[1]; $m_subject = $summary[2]; ? Let me ask you, is $m_id a character or a integer variable, if integer get the " ' " off and the query will run ok. HTH. Jayme. -Mensagem Original- De: Martin Skjldebrand [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 16:15 Assunto: [PHP-DB] Going bonkers again ... Going bonkers again ... I have this in a script. ?php file://view jobs script include("../includes/connect.inc.php"); file://connect to the database $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id = '$m_id'"; $result = mysql_query($query , $mysql_link); $summary = mysql_fetch_row($result); $m_sender = $summary[0]; $m_date = $summary[1]; $m_subject = $summary[2]; ? Where m_id is passed to the page and connect.inc.php is my database connection script which works nicely with all other pages. Still I get: Warning: Supplied argument is not a valid MySQL-Link resource in /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 7 Warning: Supplied argument is not a valid MySQL result resource in /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 8 When running this in Mozilla. What can produce this and how do I track the 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] -- 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 Mail - Webmail ??
I don't know if you need a special class to send an email, the php mail function do this in a way you can read it on every browser or email program . HTH Jayme. -Mensagem Original- De: Xsarus Internetdiensten [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 18:55 Assunto: [PHP-DB] PHP Mail - Webmail ?? Huy, how to build mails in PHP with txt-mails AND HTML-mails AND visible in Webmail (like Hotmail, USANet) With the class below I can only make HTML-mails readable in Outlook etc. Why are the mails not shown in USANet? Daniel Kieviet Xsarus Internetservices Holland [EMAIL PROTECTED] http://www.xsarus.nl -- 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] RE: [PHP] Printing MySQL into HTML Tables
Congratulations !! Very good solution ! Simple and efficient ! Cheers, Jayme. -Mensagem Original- De: Michael Rudel [EMAIL PROTECTED] Para: [EMAIL PROTECTED]; 'PHP-DB mailinglist' [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 08:29 Assunto: RE: [PHP-DB] RE: [PHP] Printing MySQL into HTML Tables Or try this one, its simple but more universal and very usefull for eg. testing. ... and a bit mor structured 8)=) ?php function result_all( $sql_result ) { echo "TABLE\n"; $columns = mysql_num_fields( $sql_result ); for ( $i = 0; $i $columns; $i++ ) { echo " TH ".mysql_field_name( $sql_result, $i )." /TH\n"; } while ( $row = mysql_fetch_row( $sql_result ) ) { echo " TR\n"; for ( $count = 0; $count $columns; ++$count ) echo " TD ".$row[$count]." /TD\n"; } echo " /TR\n"; } echo "/TABLE\n"; } ? Greetinx, Mike Michael Rudel - Web-Development, Systemadministration - ___ Suchtreffer AG Bleicherstrae 20 D-78467 Konstanz Germany fon: +49-(0)7531-89207-17 fax: +49-(0)7531-89207-13 e-mail: mailto:[EMAIL PROTECTED] internet: http://www.suchtreffer.de -- 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] comparison table script
As you can only navigate record by record through the database table I think the only way, as far as I know, is to store the record values into array variables and print it to the page after you'd reached the last record. HTH Jayme. -Mensagem Original- De: olinux [EMAIL PROTECTED] Para: [EMAIL PROTECTED]; PHP-DB [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de maro de 2001 00:52 Assunto: [PHP-DB] comparison table script I would like to make a comparison script that will compare two items. Here is an example and my "halfway" there solution. [at least i think so Here is my table [for the sake of this example] +-+ | car_ID |make | model | color | +-+ | | | | | | | | | | | | | | | | | | | | ||_||| I would like the user to be able to select two or more cars to be compared [these will be passed from an html form as car_ID Table will be laid out something like this. +-+ | |Car 1 | Car 2| Car 3 | +-+ | car_ID |123 |234 | 345 | +-+ | make|honda | honda | ford | +-+ | model |civic | civic | tempo | +-+ | color |black | blue | red | +-+ basically the table is just displayed with fields and records transversed [switched] Now i select the info for the two cars, and $result holds the finished query OK now to display it. the first while loop will write the rows. $table = "TR"; while ($row = mysql_fetch_array($result)) { $carID = $row['carID']; $make = $row['make']; $model = $row['model']; $color = $row['color']; $table .= "TDCar ID/TDTD$car_ID[1]/TD"; 2nd while loop - writes TD's which vary based on number of carID's selected It will loop until all cars have been included somehow i need to change $carID[1] to $carID[2] so I need some help on the best way to do this... After i am able to do this I will loop thru until it does not exist, in the case of the table above it would be $car_ID[4] $next will represent previous number of the array +1 /* start of second while or if/for loop */ if ($car_ID[$next] != "") $table .= "TD$car_ID[$next]/TD"; So basically that is as far as i have got. I would appreciate if anyone can provide some direction Thanks much, olinux -- 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] class method
I need a little more information to help you. Is the $query variable a global one ? Or is it a property of the class ( var $query; ) ? Why are you assigning the "mysql_fetch_array" function to a variable if call it is easier ? You have misplaced the "if $result" statement, the right position, I think , is : function getdata() { $this-sql = $query; $result = mysql_query($query); if( $result ) { // Check if $result is valid instead of NOT valid // $fetch = "mysql_fetch_array"; while ($row = mysql_fetch_array($result)) { $this-field = $row['$this-field']; } } else $this-error = mysql_error(); return; } HTH Jayme. www.conex.com.br/jjeffman/antispam.html -Mensagem Original- De: bryan [EMAIL PROTECTED] Para: db [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 16:21 Assunto: [PHP-DB] class method I am really new working with classes. Some of the ideas I am getting, some I am not. I wrote this simple little class, with a connection method, and a method to loop through the data. I am not even sure if my code is write (for the loop), but I am having trouble displaying the data. My connection works fine, but my loop is jacked. Could anyone suggest or maybe correct a mistake (if you see any)? Just looking to see if I am started in the right direction, or if I have this all bass ackwards. I have no clue if this is even possible. I am looking to create a while loop for whatever query I run, and make each row equal to whatever field I put in. I have all variables defined within the scope of my class. Thanks for your help. Code : function getdata() { $this-sql = $query; $result = mysql_query($query); $fetch = "mysql_fetch_array"; while ($row = $fetch($result)) { $this-field = $row['$this-field']; } if(!$result) { $this-error = mysql_error(); return; } } ** End thanks!!! [ bryan fitch . programmer . [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] Dynamically build a form from mySQL table
If you are using MySQL you can use the "mysql_list_fields" to get the fields names from a table. HTH Jayme. -Mensagem Original- De: Martin E. Koss [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 12:02 Assunto: [PHP-DB] Dynamically build a form from mySQL table Hi, I've been trying to figure this out by looking through the code in phpMyAdmin but I'm not getting very far. What I want to do is dynamically generate a form where I get a table row containing the field name in one cell and the input field in the next cell, for example: $DatabaseName = "FocusDynamics"; $TableName = "Items"; // open the table and get all field names, sizes, etc., // for each Field name, print something like: PRINT "tr\n"; PRINT "td$FieldName/td\n"; PRINT "tdinput type=\"text\" name=\"$FieldName\" value=\"$FieldValue\" maxlength=\"FieldSize\"/td\n"; PRINT "/tr"; How do I get all this info from the table? Thanks for any help. Martin E. Koss M: 07946-706459 E: [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] No. of Users online right now?
Have a look on Sessions. You can also write to a database every time a new visitor runs into your site and check if the other are still connected. You have to create a script that tracks every movement of the visitor. It is not a simple script. As far as I know the web server doesn't give you this information . HTH. Jayme. -Mensagem Original- De: Dan Eskildsen [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de maro de 2001 07:46 Assunto: [PHP-DB] No. of Users online right now? Hi there, This is a NewBie Question: While out surfing I have often seen a message like: "There are 17 users on this site at the moment." Can I do this with php? Just to show how many people are on (browsing) the site at that moment? I run a community website. Thanks == Regards from Denmark, Europe Please cc your reply to [EMAIL PROTECTED] == I haven't lost my mind, I've got it backed up on TAPE somewhere... -- 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] if () and () - newbie Q
Try the "empty($variable)" function. HTH Jayme. -Mensagem Original- De: Michael Gerholdt [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sbado, 17 de maro de 2001 23:12 Assunto: [PHP-DB] if () and () - newbie Q Why won't this work for me? if (($rectype == 'events') and ($action == '') and ($manage == '')){} I've also tried if ($rectype == 'events') and ($action == '') and ($manage == ''){} I want to have differences between this and something like: if (($rectype == 'events') and ($action == 'add') and ($manage == 'some')) Also - what about something like 'isNull' ? I don't see any documentation in the PHP online manual nor is 'null' even mentioned in the index of my Core PHP book. Regards, Michael Gerholdt SUNY College at Fredonia -- 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] Help w/ displaying return vals
Use mysql_function(...) or die( mysql_error()) on every mysql function or command you're performing, this will tell you what is going wrong . HTH Jayme. -Mensagem Original- De: [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Enviada em: quarta-feira, 14 de maro de 2001 19:47 Assunto: [PHP-DB] Help w/ displaying return vals Here's my php program, I think $result never gets assigned a value, staying null or whatever. $link = mysql_connect("host"); mysql_select_db("dbname"); $result = mysql_query ("SELECT * FROM table"); $fields = mysql_num_fields ($result); $rows = mysql_num_rows ($result); $table = mysql_field_table ($result, $i); echo "Your '".$table."' table has ".$fields." fields and ".$rows." records BR" - - EOP - - The problem comes on the lines that reference the variable $result. I keep getting this in the browser... leading me to believe that $result is null: Warning: Supplied argument is not a valid MySQL result resource help! Thankx0r Ryan -- 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] 2 while loops - 2 tables
If the tables have a one to many relationship you can use nested while loops: while(1st loop){ // display header - master table while(2nd loop){ // display features - detail table } } HTH Jayme. -Mensagem Original- De: olinux [EMAIL PROTECTED] Para: PHP-DB [EMAIL PROTECTED] Enviada em: quinta-feira, 15 de maro de 2001 01:05 Assunto: [PHP-DB] 2 while loops - 2 tables I am trying to display info from 2 tables in a search result format. My problem is... how do I get the variables to display together? for example: A user selects a city to search apartments in. $sql = "SELECT * FROM $table_name WHERE apt_city = \"$apt_city\" "; $result = mysql_query($sql, $connection); while ($row = mysql_fetch_array($result)) { $aptID = $row['aptID']; $apt_address1 = $row['apt_address1']; $apt_address2 = $row['apt_address2']; $apt_zip = $row['apt_zip']; } while ($row = mysql_fetch_array($result)) { $apt_ID = $row['apt_ID']; $feature1 = $row['feature1']; $feature2 = $row['feature2']; $feature3 = $row['feature3']; } Now I want to display the approriate data from the apartment next to the features. so What I am wondering is how can i "group" the appropriate features with the correct apartment so say a result may look like this [HTML table] __ Apartment 1 | feature1 apt_address1 | feature2 apt_address2 | feature3 _|_ Apartment 2 | feature1 apt_address1 | feature2 apt_address2 | feature3 _|_ Apartment 3 | feature1 apt_address1 | feature2 apt_address2 | feature3 _|_ Should the 2nd while loop be placed inside the first? while ($row = mysql_fetch_array($result)) { $aptID = $row['aptID']; $apt_address1 = $row['apt_address1']; $apt_address2 = $row['apt_address2']; $apt_zip = $row['apt_zip']; while ($row = mysql_fetch_array($result)) { $apt_ID = $row['apt_ID']; $feature1 = $row['feature1']; $feature2 = $row['feature2']; $feature3 = $row['feature3']; } $table_block .= "[ this contains HTML code for table rows to display data ]"; } Thanks Much! olinux -- 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] (Newbie) how to evaluate a varying number of db generated checkboxes?
If you have a way to decide which checkboxes have to be checked, just set its attribute like the line bellow: INPUT TYPE="checkbox" NAME="" ?PHP if($condition) echo("CHECKED");? HTH Jayme. -Mensagem Original- De: jester [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 7 de maro de 2001 14:00 Assunto: [PHP-DB] (Newbie) how to evaluate a varying number of db generated checkboxes? I'm generating a html form with php and a MySQL database. My code generates a varying number of checkboxes depending on the number of 'options' in my database. The name of the checkbox is set to the -id- of the 'option' in my database. When the generated form is posted I want to show a page showing a overview of the 'options' checked. But how do I check if that varying number of checkboxes is 'checked' ?? db connect and query, result of query is placed in: $result . while($row=mysql_fetch_array($result)) { print("form method=\"post\" action=\"formhandler.php\""); $optionID=$row["id"]; $optionDescription=$row["description"]; print("input type=\"checkbox\" name=\"$optionID\" $optionDescriptionbr\n"); print("/form"); } But how can I get this 'unknown' number of checkboxes in my next page and evaluate if they are checked so I can leave out the unchecked ones in my overview. Who can help me with this problem?! Thanx! H. de Visser -- 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] mail server
I'm not sure but I think you must have a smtp server program running to configure as your smtp server. HTH. Jayme. -Mensagem Original- De: Free Beachler [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 7 de maro de 2001 14:48 Assunto: [PHP-DB] mail server hi all, is there any way i can specify my own smtp server and override the php.ini file? i want to use the mail command on my host and i keep getting this error: Warning: Unknown error in D:\inetpub\nextepmedia\www\nexteplaunch\test_email.php on line 2 i just have a simple php file with a mail command to mail to me, something like: mail('[EMAIL PROTECTED]', 'test email', 'line1\nline2\line3'); anyway, i'm on this NT host and they're not that good. instead of having them go into their php.ini file and see what's wrong i want to set my own server (in the script) to point to our host's SMTP server. -f -- 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] MySQL - Problem with multiple INSERTs?
Try this changes: $con_id = mysql_connect("localhost", "myusername", "mypassword"); if($con_id){ mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (0, 'sysmsg9.txt', 'Some file')"); } else echo("Connection failed"); -Mensagem Original- De: Chris [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 6 de maro de 2001 16:13 Assunto: Re: [PHP-DB] MySQL - Problem with multiple INSERTs? I did change the id fields from TINYINT to INT (that was just a careless error), and fixed something else. But I still have the same problems. The new table schemas are below, along with the queries that don't work. I'd love for someone to reproduce the error. As a possible workaround, everything seems to be fine when I prime the tables by adding a record; they only seem to have a problem when the tables are empty. Thanks, Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id int(11) NOT NULL auto_increment, idProject int(11) DEFAULT '0' NOT NULL, idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); -- 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] detect cookies
I've never used but there is a php function "get_browser()" which might do the work. I think the best way is set the cookie and try to get it again, if you can get it the user has cookies enabled. setcookie("name",value,$cookieLifeTime,$cookiePath); if($name) echo("Cookie is enabled"); HTH Jayme. -Mensagem Original- De: andrie [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 6 de maro de 2001 18:34 Assunto: [PHP-DB] detect cookies Hello php-db, can i detect weather user has enable or not their cookies ? or is there any function that can read browser setup ? -- Best regards, andrie mailto:[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] mysql_fetch_array problem...!
You must use a loop to show each row of your query. "mysql_fetch_array($result)" only get the current row. while($row = mysql_fetch_array($result) ){ // do something } The "mysql_fetch_array" function returns an associative array where you can use the field names to have access to its value : $row = mysql_fetch_array($result) ; $v1 = $row["fieldname1"] ; $v2 = $row["fieldname2"] ; $v3 = $row["fieldname3"] ; You're going to use the alias names you are creating on the query. See more details on php manual at mysql functions. HTH. Jayme. -Mensagem Original- De: Trond Erling Hundal [EMAIL PROTECTED] Para: PHP-DB-LIST [EMAIL PROTECTED] Enviada em: segunda-feira, 5 de maro de 2001 09:56 Assunto: [PHP-DB] mysql_fetch_array problem...! I want to run a query to my db, fetching different fields from three different tables. In order to recognise the individual fields I give them names: select portal.portal as portal, portal.portalid as id... etc etc How can I refer to one specific row in this query..? What I mean is, how can i refer to result row number 4...? If I only selected rows from one table I could do something like this: $i = mysql_fetch_array($sql) ; echo "$i[4]" ; -- 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] MySQL - Problem with multiple INSERTs?
Have you put an echo with mysql_error() after performing each query ? Jayme. -Mensagem Original- De: Chris [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 5 de maro de 2001 05:04 Assunto: [PHP-DB] MySQL - Problem with multiple INSERTs? Howdy, I'm getting weird problems trying to INSERT to two different tables, in consecutive mysql_queries. Before, I had 3 queries going, and only 2 would work at any time. It seemed like it was 'rotating' the bad query - first the 1st query would fail (the other two were fine), then I'd empty all my tables and refresh, and this time the 2nd query was the problem, and if I did it again the 3rd was. All queries worked fine in phpMyAdmin, both individually and when executed en masse. I've boiled it down to just two queries that don't work. I've included everything below (including table schemata), to enable reproduction. It seems like a bug to me - the question is, is the bug in PHP, MySQL, or my brain? This is driving me CRAZY - Chris mysql_connect("localhost", "myusername", "mypassword"); mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) VALUES (1, 'sysmsg9.txt', 'Some file')"); CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY (id) ); CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, comment text NOT NULL, PRIMARY KEY (id) ); (P.S. I've tried things like using SET syntax, using mysql_query instead of mysql_db_query, etc. Nothing helps.) -- 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] Insert a file in a mysql database!
Look for "load in file" on MySQL manual. HTH. Jayme. -Mensagem Original- De: Pedro M. S. Oliveira [EMAIL PROTECTED] Para: PHP db [EMAIL PROTECTED] Enviada em: sbado, 3 de maro de 2001 18:03 Assunto: [PHP-DB] Insert a file in a mysql database! Hi all... Here i am once again asking for advice :) well i need to put a file (something lika *.doc or *.rtf) on a mysql database. The thing is: the user need to upload a computer file to the mysql runing over a linux box. i would like to know: 1) what is the best way to do this? 2) what is the html code i have to generate do do this? 3) how can i read this back from the database? i read something about sending the file over ftp and then on the database put just the path to the file. but what is your opinion? thankx *** Pedro Miguel Silva Oliveira Cell Phone: +351 96 5867227 SMS: [EMAIL PROTECTED] Email: [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] How do I keep the selected showing...
Use the "selected" attribute of the option tag when you load the second page, marking the place the user had chosen : option . option ... option selected value="g"City G option... HTH Jayme. -Mensagem Original- De: Dave Carrera [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sbado, 3 de maro de 2001 04:29 Assunto: [PHP-DB] How do I keep the selected showing... Hi All I have a fully functional db site which uses 2 sqls and 1 page to give our visitors info they need. That works fine, but some users have remarked that it would be nice that the selected item from our drop down list stays shown when the page gives the info instead of going back to the top of the list. http://www.angelettes.co.uk/dates/index.php3 is the url in action and choosing different towns will show you what I mean. Its not the end of the world, as our visitors have said, but would be nice. Any help is full appreciated. Dave C -- 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
David Siegel in "Creating Killer Web Sites" 1st edition said frames are good only for show details of a list of objects like recipes, products or in your case news! You can have a frameset with three frames say top, left and main (center). Put some ad on the top , the headlines of your news on the left and its bodies on the main frame . You can limit the number of headlines using the keyword "limit" ( see MySQL manual ) and put a anchor tag in every headline to a php script passing the "news_id" and show the selected new on the main frame. HTH Jayme. -Mensagem Original- De: Matthew Cothier [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 28 de fevereiro de 2001 13:13 Assunto: [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] -- 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] Drop down box
The event "OnChange" only happens when the user open the drop down list and change ( select ) a new value, this is not "just looking" . I don't like this kind of solution. If I have to put a button on the page I think the selection list must disappear. Why not give the user a interface with less "clicks"? May be we can reach another interface approach which turn it possible. Jayme. -Mensagem Original- De: Ron Brogden [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quinta-feira, 1 de maro de 2001 18:48 Assunto: Re: [PHP-DB] Drop down box At 06:32 PM 3/1/2001 -0300, you wrote: The action you want is only available using JavaScript. True but the action *you* want is most definitely not what many of your *users* are going to want. If you use Javascript this way your site will be un-navigable if Javascript is turned off or the browser does not support it. What's the big deal about a single button click? Also, using Javascript this way means that if a user is just curious what the choices are, you force a refresh without them necessarily wanting one. IMHO of course. 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] -- 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] onMouseOver onMouseOut
Are you trying to tell Rudi Ahlers is possible to call php scripts from a browse event ? The statement "form.submit()" belongs to JavaScript not to php. Can you imagine how boring is have to submit forms and reload pages every time the user make changes on a drop down menu? I know you're right about disable JavaScript on the browser but I think security matters are more applicable to MS Active X which even writes to your HD, as far as I know JavaScript is not allowed to do that. Of course you can't make password validation client side, there is no data security client side. I think academic and radical positions aren't good at all. You should deal with the real world where you have the give the user as much comfort as you can. Applications don't have proper life, they are created for been used, so the user is always the king. -Mensagem Original- De: Ron Brogden [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de fevereiro de 2001 18:40 Assunto: Re: [PHP-DB] onMouseOver onMouseOut At 06:27 PM 2/23/2001 -0300, you wrote: Remember, php is server side while JavaScript is client side. You can't use php client side. You can use some client side events to call php scripts which will run on the server and send data to the browser. Events are client side, so try JavaScript you'll enjoy it too. Also keep in mind that Javascript should *never* be relied upon for input validation. It is trivial to disable Javascript on the client side (and there are very good reasons for doing so, drop by www.securityfocus.com sometime for reasons why) and you cannot trust any data that comes from the end user. I personally would never recommend Javascript "crippling" your site - it should run perfectly without it since support varies from browser to browser (not everyone uses the latest version of IE) and you have no guarantee that it will be enabled client side at all. That's not even getting into people building URLs by hand for "kicks". Since you have to perform input validation server side anyway, this makes Javascript pretty much useless for this purpose. Javascript is really only useful for display effects that do not affect accessibility which means they should be avoided most of the time just like Macromedia Flash, Quicktime, etc. unless you are 100% sure your audience meets your site's requirements exactly. All IMHO of course. Cheers, Ron -- --- 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] -- 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] onMouseOver onMouseOut
Remember, php is server side while JavaScript is client side. You can't use php client side. You can use some client side events to call php scripts which will run on the server and send data to the browser. Events are client side, so try JavaScript you'll enjoy it too. HTH Jayme. -Mensagem Original- De: Rudi Ahlers [EMAIL PROTECTED] Para: PhP List [EMAIL PROTECTED] Enviada em: sexta-feira, 23 de fevereiro de 2001 14:00 Assunto: [PHP-DB] onMouseOver onMouseOut Is there such a function for PhP ? I want to replace some javasctiripts with PhP, but there are quite a few onmouseover events. Thank you Rudi "Opinions expressed do not necessarily represent the views of my employer." -- 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] nl2br()
Look for "nl2br()" on the php manual. There is more information there. Any way you can store text fields as the user has typed it in, when you are about to show them what they wrote you get text from database and apply the function on the result before put it in a html tag. select * ... ... $text_ready = nl2br($row["text"]) ; HTH. Jayme. -Mensagem Original- De: Matthew Cothier [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 21 de fevereiro de 2001 18:11 Assunto: [PHP-DB] nl2br() Where exactly do I need to insert 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]
Re: [PHP-DB] next previous record
I don't know about "Cursors" but I think you can use the same approach we discussed on navigate record by record, " retrieval of NEXT, PREV records" was the subject. If set an order by clause and search for the first record you can use a where clause like this : ... $current = $row["field"] ; // for next row $query = "select * from table where field_name '$current' limit 1"; // for previous row $query = "select * from table where field_name '$current' limit 1"; HTH Jayme. www.conex.com.br/jjeffman/antispam.html -Mensagem Original- De: Andrew Hill [EMAIL PROTECTED] Para: Dreamvale [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: quinta-feira, 22 de fevereiro de 2001 14:10 Assunto: RE: [PHP-DB] next previous record You want to use Cursors, and I don't believe MySQL supports cursors yet, although I could be wrong. Best regards, Andrew -- Andrew Hill - OpenLink Software Director Technology Evangelism eBusiness Infrastructure Technology http://www.openlinksw.com -Original Message- From: Dreamvale [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 11:42 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] next previous record I was not refering pagination. suppossing there are these 3 records ABC DEF GHI LJK now a search is done by entering D, which using like %, and limit would return the record DEF. The "next" would forward to GHI and "previous" would backward to ABC. any idea? thanks. - Original Message - From: "Brunner, Daniel" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 23, 2001 12:12 AM Subject: FW: [PHP-DB] next previous record Check this link out... http://www.oreillynet.com/pub/a/php/2000/11/02/next_previous.html?page =1 It's about Next/previous links... It does work, but I've yet to get to get it to work completely with displaying the records (rows) and the links at the same time... It just takes some time to find how to use the mysql_query variable to print out the rows, with every click of the link.. If you get any head way let me know... It's great code Dan -- From: Dreamvale Sent: Thursday, February 22, 2001 9:55 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] next previous record hi all, need to implement record scrolling, one at a time -either forward or backward, on MySQL. The key is a char (32) containing part numbers. anyone has done this before? thanks in advance. dreamvale -- 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] -- 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] retrieval of NEXT, PREV records
As far as I know, if you do not set any special order, the table is ordered by primary key, isn't it ? Jayme. -Mensagem Original- De: Chris Book [EMAIL PROTECTED] Para: JJeffman [EMAIL PROTECTED]; Adv. Systems Design [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: quarta-feira, 21 de fevereiro de 2001 11:16 Assunto: RE: [PHP-DB] retrieval of NEXT, PREV records you have to make sure you order by Rec_id all the time too. -Original Message- From: JJeffman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 20, 2001 4:39 PM To: Adv. Systems Design; [EMAIL PROTECTED] Subject: Re: [PHP-DB] retrieval of NEXT, PREV records "SELECT * FROM Table WHERE Rec_id $recid LIMIT 1" always bring you the next record no matter the Rec_id is. HTH Jayme. -Mensagem Original- De: Adv. Systems Design [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de fevereiro de 2001 11:41 Assunto: [PHP-DB] retrieval of NEXT, PREV records I have set up links to browse records one by one, using (ID+1) for NEXT and (ID-1) for PREV...the only problem is that if there is a hole in the ID sequence (as from DELETION), there is no record returned...How can I have it so that the 'holes' are paved over and not returned? TIA Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! 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] -- 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] retrieval of NEXT, PREV records
I'm sorry I haven't noticed that. I couldn't believe, then I tried to create and make some delete-insert operations and the primary key order has gone away. Thanks a lot. One more lesson I learned. Jayme. -Mensagem Original- De: Sweep the Net [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 21 de fevereiro de 2001 19:06 Assunto: RE: [PHP-DB] retrieval of NEXT, PREV records It would only be ordered that way if you had not deleted any records and added new ones. IF there are ones deleted, the next ones frill in the space. Bob At 05:00 PM 2/21/01 -0500, you wrote: Perhaps it is ordered that way, perhaps not, but live by the creed "Expect nothing and you will never be disappointed." Go ahead and specify the order you demand. -Original Message- From: JJeffman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 21, 2001 4:40 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] retrieval of NEXT, PREV records As far as I know, if you do not set any special order, the table is ordered by primary key, isn't it ? Jayme. -- 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] retrieval of NEXT, PREV records
"SELECT * FROM Table WHERE Rec_id $recid LIMIT 1" always bring you the next record no matter the Rec_id is. HTH Jayme. -Mensagem Original- De: Adv. Systems Design [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de fevereiro de 2001 11:41 Assunto: [PHP-DB] retrieval of NEXT, PREV records I have set up links to browse records one by one, using (ID+1) for NEXT and (ID-1) for PREV...the only problem is that if there is a hole in the ID sequence (as from DELETION), there is no record returned...How can I have it so that the 'holes' are paved over and not returned? TIA Luis __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! 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] -- 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] Array element as object.
I've already made an object which had a property that was an array. Now I need to have an array that can hold objects as its elements is It possible ? I didn't get it the expression array[$i]-Object gave me syntax error. Any tips ? []'s Jayme. http://www.conex.com.br/jjeffman -- 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] Drop-down menu selection
You need mix JavaScript and PHP. Write an "OnChange" event handler for the "campus" selection list and fill up the "buildings" drop-down menu in two ways: 1) If the amount of data is not very large you can get all data needed to run the "application" client side, load the data into JavaScript arrays and refresh the select boxes using JavaScript scripts. Otherwise you must reload the page and process the values posted by the form. 2) Reload the same page (window.location="self.php?campus=value") and run your php script to fill up the "buildings" drop-down menu. HTH. Jayme. -Mensagem Original- De: Julio Cuz, Jr. [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 20 de fevereiro de 2001 21:44 Assunto: [PHP-DB] Drop-down menu selection Hi-- I hope all of you are having a great long weekend! Let's say I have four (4) tables: - "campus" that holds all my campuses' names (only 3), - "building_campus1" that holds all buildings for 'campus1', - "building_campus2" that holds all buildings for 'campus2', - "building_campus3" that holds all buildings for 'campus3'. If the user selects "campus 1" from a drop-menu, how can I select "buildings for campus 1" on a second drop-down menu? In other words, how do I select the corresponding "building's table" when any "campus" is selected? Thanks! P.S. I have tried the 'onChange' command, but I guess I got the syntax wrong: = // $campus: ?php echo("SELECT onChange='building.value = building.this.value' NAME='campus'"); $cmlist = @pg_exec($db, "SELECT * FROM \"Campus\"") or die(include("../sqlerror.inc")); $i = 0; $x = pg_numrows($cmlist); while ($i $x): $clist = pg_fetch_array($cmlist,$i); echo "OPTION VALUE='".$clist["Campus"]."'".$clist["Campus"]."/OPTION"; $i++; endwhile; echo("/SELECT"); ? $building: ?php echo("SELECT NAME='building'"); $cmlist = @pg_exec($db, "SELECT * FROM building_$campus") or die(include("../sqlerror.inc")); $i = 0; $x = pg_numrows($cmlist); while ($i $x): $clist = pg_fetch_array($cmlist,$i); echo "OPTION VALUE='".$clist["Building"]."'".$clist["Building"]."/OPTION"; $i++; endwhile; echo("/SELECT"); ? = Julio Cuz, Jr. Riverside Community College [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] composite keys
MySQL do support composite keys . Have a look on the mysql database structure the "columns_priv" table has 5 fields in its primary key. I think you should use an auto_increment as your primary field instead. HTH. Jayme. -Mensagem Original- De: Russ Michell [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 19 de fevereiro de 2001 11:21 Assunto: [PHP-DB] composite keys Hi all: I am using php4.0.3pl1 with MySQL 3.22.32 on Apache for RH Linux. I have a table/relation of sports, where amongst other categories, are teams, where there can be many 'teamNames' 'teamInfos' for one sport. The problem here is that without the use of a composite key: 'sportName' 'TeamName', there can be no method of uniquely identifiying a row or tuple. A smuch of the info for each sport is repeated. Does MySQL support the use of composite keys? I am using phpMyAdmin 2.1.0 to adminster my MySQL system, and this only seems to accept a single primary key for a single table. Any advice or other methods I could possibley employ, are most welcome. Regards: Russ #---# "Believe nothing - consider everything" Russ Michell Anglia Polytechnic University Webteam http://gertrude.sipu.anglia.ac.uk/webteam [EMAIL PROTECTED] +44 (0)1223 363271 ext 2331 www.theruss.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] Inserting arrays into a database
Try use a delimited string and split it on retrieve. HTH. Jayme. -Mensagem Original- De: Kyle Mathews [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 19 de fevereiro de 2001 19:35 Assunto: [PHP-DB] Inserting arrays into a database Hello: I'm wondering what is the best way to insert an array into a database table. As well as the best way to extract and show that information. The information that I'd be inserting is a bunch of id numbers for data in another table. So when getting the information, I'd like to do a table join so that the information displayed is the actual data, and not a bunch of numbers. Thanks, Kyle -- 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] Links On The Fly
You can pass the "href" as an urlencoded to your php script. HTH. Jayme. -Mensagem Original- De: Sridhar Ranganathan [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sbado, 17 de fevereiro de 2001 21:40 Assunto: [PHP-DB] Links On The Fly Hi All I have a search engine which generates a page full of links. Depending on the link that was clicked, I want to load info on the fly. How do I do that? Regards Sridhar Ranganathan _ 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] double posts
Using a JavaScript function instead of the "action" form property I think is possible . HTH. Jayme. -Mensagem Original- De: Marc Bragg [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 16 de fevereiro de 2001 17:53 Assunto: [PHP-DB] double "posts" Is it possible to post to two forms with one click, one post command? What would statement look like? -- 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] primary field
No it hasn't. The field order in the form doesn't matter, but the order you use their values in the query yes ! I don't know what kind of operation you're making on the database updating, inserting, etc. ). If you are inserting you must not give any member_id, as long as it is generated by the database server. As you won't attribute any value to member_id you must tell which fields you are inserting : "insert into table (last_name) values('$lastName')" this way you'll get no errors, at least if last_name is not a unique key . If you is updating data you can't modify the member_id which is the table primary key. HTH. Jayme. -Mensagem Original- De: Marc Bragg [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 16 de fevereiro de 2001 17:55 Assunto: [PHP-DB] primary field Does the first field in a form have special significance? Have two fields in table: last_name member_id member_id is key and autoincrement. mysql won't accept two last names as same when last_name is first field. when member_id is made first field, then can input same last name into last_name field. why is that? -- 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] Related frames
How about use "A TARGET='main' HREF=\"" ... HTH JAYME. -Mensagem Original- De: John Halladay [EMAIL PROTECTED] Para: PHP DB List (E-mail) [EMAIL PROTECTED] Enviada em: quinta-feira, 15 de fevereiro de 2001 19:46 Assunto: [PHP-DB] Related frames I'm trying to have a link in one frame display data in the main frame. Here is an example of what I have set up. Normally in HTML you would have TARGET="main" in the a href="" /a spot, but I tried that and it gives me a parse error. Any ideas on how to do it, or does anyone have know of any websites that I could check. Thanks, John Halladay html body ?php $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); // display individual record if (isset($id)) { $result = mysql_query("SELECT * FROM employees WHERE id=$id",$db); $myrow = mysql_fetch_array($result); printf("First name: %s\nbr", $myrow["first"]); printf("Last name: %s\nbr", $myrow["last"]); printf("Address: %s\nbr", $myrow["address"]); printf("Position: %s\nbr", $myrow["position"]); } else { // show employee list $result = mysql_query("SELECT * FROM employees",$db); if ($myrow = mysql_fetch_array($result)) { // display list if there are records to display do { printf("a href=\"%s?id=%s\"%s %s/abr\n", $PHP_SELF, $myrow["id"], $myrow["first"], $myrow["last"]); } while ($myrow = mysql_fetch_array($result)); } else { // no records to display echo "Sorry, no records were found!"; } } ? /body /html -- 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] MySQL compacting
I'm afraid there is no articles on this matter. You are facing a database design matter. Auto-increment primary keys must haven't any meaning other than just be the primary key and relate one table to another, if you had a function to "update" the auto-increment field to eliminate the holes that function should manage tables relationships as well. As you can see it'll be very difficult to implement and probably slows down the script, imagine check all related tables ! Although you have holes in the sequence, the order between the reminiscent records will be the same . Auto-increment fields should not be exposed to the user. HTH. Jayme. http://www.conex.com.br/jjeffman -- 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] Writing to a file on the user's machine.
I think write to the user's machine it's up to him, you can't write to it, you have to "invite" the user to download the file you created for him on the server. That's the polished application ! HTH. Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Gary Robinson [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: tera-feira, 6 de fevereiro de 2001 12:20 Assunto: [PHP-DB] Writing to a file on the user's machine. How do I write to a file on the user's machine? I need to drop a small file to the user's machine after a certain transaction. Thanks in advance! -- 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 ID
What for you need a ID if you have already the username which I guess may a unique key ? HTH. Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Brandon Feldhahn [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: segunda-feira, 5 de fevereiro de 2001 22:00 Assunto: [PHP-DB] using ID When i make a table with four field (id, name, username, and password) what do i do with the i id, how do i make it assign to each password? -- 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] refreshing form select boxes with javascript. possible?
No, JavaScript is "Client" side, while PHP is "Server" side script, so to call php scripts you have to make a request to the server. If the amount of data is not very large you can get all data needed to run the "application" client side, load the data into JavaScript arrays and refresh the select boxes using JavaScript scripts. Otherwise you must reload the page and process the values posted by the form. HTH. Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Kepa Lyman [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: quarta-feira, 7 de fevereiro de 2001 22:09 Assunto: [PHP-DB] refreshing form select boxes with javascript. possible? Hi, I have a MySQL database that contains a table of composer names/ID numbers, another of symphonies/ID numbers, and another of symphonies/composer ID's. The problem is that under the search form now, the search by name does a simple query to the symphonies/ID table and gets back a result of all available symphonies. This is cumbersome. What I would like to be able to do, is once the composer name select box on the search form is selected, have the symphony name form re-update itself to include only those symphonies done by the composer. I imagine this would use a javascript "onSelect," but every time I try to include PHP code in a onselect it gets run anyway. Any way around this? Can javascript call an exterior PHP include or something? Without refreshing the whole page? Any ideas? the url for the project is symphonynet.datablocks.net. It's the free datablocks php/MySQL deal, sometimes the connection is pretty slow. Thanks, Kepa Lyman -- 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] $result = true or false??
The "mysql_db_query()" and "mysql_query()" functions only return false (0) when you have an error in your query or parameter definition, otherwise they always return a positive result identifier. So, if you must know if is there any valid record you should ask for the row number returned : // Check if a valid result has records if(mysql_num_rows($result) 0){ // stuff } else{ // No records procedure } HTH Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Kevin Connolly [EMAIL PROTECTED] Para: [EMAIL PROTECTED] Enviada em: sexta-feira, 26 de janeiro de 2001 15:37 Assunto: [PHP-DB] $result = true or false?? Hi, $db = mysql_connect("localhost", "root"); mysql_select_db("mydb",$db); $sql = "SELECT * FROM employees where first = '$login'"; $result = mysql_db_query ("mydb", $sql); echo "$result"; If I run this cose then $result always = Resource id #2 even if $login is not a member of the database. Is there anyway I can get it to output true if $login is a member and false if $login is not a member? or at least get $result to be different if $login is in the database to that when it is not? Thanks, Kevin. -- 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/PHP Form Addslashes() command
There is the "nl2br()" function too : // From php manual : nl2br -- Converts new lines to HTML line breaks. Description string nl2br(string string); Returns string with 'BR' inserted before all new lines. HTH Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Rubanowicz, Lisa [EMAIL PROTECTED] Para: 'James Smith' [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: sexta-feira, 26 de janeiro de 2001 07:59 Assunto: RE: [PHP-DB] MySQL/PHP Form Addslashes() command I am a beginner but did it like this, with a little help from my friends!! $query = "INSERT INTO guests "; $query .= "(guest_id, guest_name, "; $query .= "guest_email, guest_time, guest_message) "; $query .= "values(, '$name', '$email', NULL, '" . str_replace("\n","br", $message) . "')"; Where $message is the TEXTAREA box submitted All the best Lisa -Original Message- From: James Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 25, 2001 8:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL/PHP Form Addslashes() command Alright, you have a textarea in a form, say some one right this: Today, during the meeting blah blah blah... (now they want to start a new paragraph, so they press enter twice.) After the construction meeting blah blah blah... Ok... Now the question. The addslashes() command won't add the NULL spots to make it a new paragraph when you open this row in a page. How do I get that to work... Thank You, James Smith __ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.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] -- 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] failure notice
The last time I sent a message to php-list-admin asking for stop this kind of messages they took the email address off but I was fired of the list too. Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Jon Niola [EMAIL PROTECTED] Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: quinta-feira, 25 de janeiro de 2001 16:17 Assunto: Re: [PHP-DB] failure notice Could someone please block this guy's address from the list? I am getting sick of this crap At 08:00 AM 1/25/01 -0800, Mike wrote: Hi. This is the qmail-send program at toye.php.net. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. [EMAIL PROTECTED]: ezmlm responseezmlm-send: fatal: message already has a Mailing-List header (maybe I should be a sublist) (#5.7.2) [EMAIL PROTECTED]: ezmlm-manage: fatal: message already has a Mailing-List header (maybe I should be a sublist) (#5.7.2) --- Below this line is a copy of the message. Return-Path: [EMAIL PROTECTED] Received: (qmail 10167 invoked from network); 25 Jan 2001 01:00:32 - Received: from unknown (HELO gull.prod.itd.earthlink.net) (207.217.121.85) by va.php.net with SMTP; 25 Jan 2001 01:00:32 - Received: from michaelbowman (sdn-ar-002orportP225.dialsprint.net [63.178.64.241]) by gull.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id RAA23822; Wed, 24 Jan 2001 17:03:01 -0800 (PST) From: "Mike" [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] Received: from toye.php.net ([198.186.203.51]) by vespasian.mspring.net (Mindspring Mail Service) with SMTP id t6unep.ja4.37kbpqe for [EMAIL PROTECTED]; Wed, 24 Jan 2001 17:57:28 -0500 (EST) Received: (qmail 19654 invoked by uid 1013); 24 Jan 2001 22:54:52 - Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] Date: Wed, 24 Jan 2001 17:04:11 -0800 Message-ID: [EMAIL PROTECTED] Content-Transfer-Encoding: quoted-printable Delivered-To: responder for [EMAIL PROTECTED] X-Mailer: Microsoft Outlook Express 5.50.4522.1200 Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 - Received: from unknown (HELO scaup.prod.itd.earthlink.net) (207.217.121.49) by va.php.net with SMTP; 24 Jan 2001 22:54:52 - Received: from michaelbowman (sdn-ar-012orportP142.dialsprint.net [63.180.14.206]) by scaup.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with SMTP id OAA16305 for [EMAIL PROTECTED]; Wed, 24 Jan 2001 14:57:21 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Subject: ezmlm response Hi! This is the ezmlm program. I'm managing the [EMAIL PROTECTED] mailing list. I'm working for my owner, who can be reached at [EMAIL PROTECTED] This is a generic help message. The message I received wasn't sent to any of my command addresses. --- Administrative commands for the php-db list --- I can handle administrative requests automatically. Please do not send them to the list address! Instead, send your message to the correct command address: To subscribe to the list, send a message to: [EMAIL PROTECTED] To remove your address from the list, send a message to: [EMAIL PROTECTED] Send mail to the following for info and FAQ for this list: [EMAIL PROTECTED] [EMAIL PROTECTED] Similar addresses exist for the digest list: [EMAIL PROTECTED] [EMAIL PROTECTED] To get messages 123 through 145 (a maximum of 100 per request), mail: [EMAIL PROTECTED] To get an index with subject and author for messages 123-456 , mail: [EMAIL PROTECTED] They are always returned as sets of 100, max 2000 per request, so you'll actually get 100-499. To receive all messages with the same subject as message 12345, send an empty message to: [EMAIL PROTECTED] The messages do not really need to be empty, but I will ignore their content. Only the ADDRESS you send to is important. You can start a subscription for an alternate address, for example "[EMAIL PROTECTED]", just add a hyphen and your address (with '=3D' instead of '@') after the command word: [EMAIL PROTECTED] To stop subscription for this address, mail: [EMAIL PROTECTED] In both cases, I'll send a confirmation message to that address. When you receive it, simply reply to it to complete your subscription. If despite following these instructions, you do not get the desired results, please contact my owner at [EMAIL PROTECTED] Please be patient, my owner is a lot slower than I am ;-) --- Enclosed is a copy of the request I received. Return-Path: [EMAIL PROTECTED] Received: (qmail 19617 invoked from network); 24 Jan 2001 22:54:52 - Received: from unknown (HEL
Re: [PHP-DB] Newbie - 2 tables one insert
Are you trying to get the auto_increment "id" used in the last Insert ? If so, try this function: // int mysql_insert_id(int [link_identifier] ); $last_id = mysql_insert_id($result); $sql2 = "INSERT INTO pages page_id values($last_id ); $result2 = mysql_query($sql2); HTH Jayme. http://www.conex.com.br/jjeffman -Mensagem Original- De: Rubanowicz, Lisa [EMAIL PROTECTED] Para: Rubanowicz, Lisa [EMAIL PROTECTED]; [EMAIL PROTECTED] Enviada em: tera-feira, 23 de janeiro de 2001 11:54 Assunto: RE: [PHP-DB] Newbie - 2 tables one insert I realised I just sent my password out needless to say I am just about to change it. All the Best Lisa -Original Message- From: Rubanowicz, Lisa [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 23, 2001 1:54 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Newbie - 2 tables one insert Hi all, Could you please help me out on this one. I want to create a web site using two tables. 1. page_creation - Stores page_id and page_name to be shown on all navigation bars. 2. pages - Contains pg_id, page_id, etc etc. I want to do an insert into page_creation to create a new page and then pass the page_id to pages, so I know the info stored in "pages" relates to a certain page (one to many relationship). In the code below I want this to be an "Add a New web Page" where the user types in a Page Name shown in the nav bar and it enters data as above. I have been trying for three days now with different methods and it is driving me mad. Thank you in advance for your assistance ? if ($page_name) { $host="db9.pair.com"; $user="c3po"; $password="13Balreask"; $dbasename="c3po_test"; mysql_pconnect("$host","$user","$password") or die("Unable to connect to SQL server"); mysql_select_db("$dbasename") or die("Unable to select database"); $sql1 = "INSERT INTO page_creation pagename"; $sql1 = "values('$page_name')"; $result = mysql_query($sql1); $sql2 = "INSERT INTO pages page_id values('$result'); $result2 = mysql_query($sql2); } else { ? HTML HEAD /HEAD BODY BGCOLOR="#FF" FORM ACTION="test_2_tables.php" METHOD="POST" INPUT TYPE=TEXT name="page_name" VALUE="?echo $page_name ?" SIZE=20 INPUT TYPE=SUBMIT VALUE="Add a New Page" /FORM /BODY /HTML ? } ? Lisa Rubanowicz Case ITC, Navan, Ireland Tel: #353 (0)46 77663 [EMAIL PROTECTED] mailto:[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] Include problem.
I am running PHP3.017(cgi) + Apache + MySQL on Windows98 SE. The include() and the getenv() functions are asking for a dial-up connection. Can somebody give me a hand ? Jayme. http://www.conex.com.br/jjeffman -- 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]