RE: [PHP-DB] SQL query
Make sure that your second query is returning only one row, if it dont help, try this: $query=select email from usuarios where userName in (select username from fussv where folio = 'FUSS-130-2006') MySQL think that you second query returns more than 1 row, that's why mysql dont accept your query, is like trying to compare vs more than one scalar value Regards! ++ | Ing Edwin Cruz [EMAIL PROTECTED] | ++ | Transportes Medel Rogero SA de CV | | | | Desk: +52 (449) 910 30 90 x3054 | ++ | MX Mobile: +52 (449) 111 29 03 | | Aguascalientes, Mexico | | http://www.medel.com.mx | ++ -Mensaje original- De: Miguel Guirao [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 28 de Septiembre de 2006 09:09 a.m. Para: php-db@lists.php.net Asunto: [PHP-DB] SQL query Hello list, Whats wrong with my SQL query: $query=select email from usuarios where userName = (select username from fussv where folio = 'FUSS-130-2006'); I get an error! I have tested the two individual sentences and they worked OK! --- Miguel Guirao Aguilera Logistica R8 TELCEL Tel. (999) 960.7994 Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Sending filing attachments using PHP
Have a look on this: http://framework.zend.com/manual/en/zend.mail.attachments.html It seems to be easy with zend framework -Mensaje original- De: Ron Piggott (PHP) [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 11 de Mayo de 2006 05:34 p.m. Para: PHP DB Asunto: [PHP-DB] Sending filing attachments using PHP Does any one know how to send a file attachment using PHP? I have been using the mail() command to send e-mail in various scripts, but have spotted a file attachment syntax to use on the php web page. Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Problem with select-tag within a php-script
Hi, Ruprecht Helms [EMAIL PROTECTED] wrote: [snip] while($row = mysql_fetch_object($result)) { echo option value=\'.$row-ID.\'; [/snip] Should be: echo option value=' .$row-ID. '; ? - E - __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] removing values from arrays
You can also use unset(): if (!array[$key]) unset array[$key]. Edwin Peter Beckman wrote: $x=0; while ($row = mysql_fetch_array($r)) { while(list($key,$val)=each($row)) { if (!empty($val)) $mydata[$x][$key] = $val; } $x++ } Peter On Wed, 21 May 2003, John wrote: ok I've been racking my brain on this for a couple of days. What I need to do is after creating an array from a query some values are 0. I need to be able to skip both the value and the key frmprinting purposes. I have it setup in a multi-demensional array, such as: Array ( [0] = Array ( [Department] = IMAX [Occurrences] = 1 [percentage resets of completed] = 0.00 [completed] = 1 [In Progress] = 0 [Waiting for Parts] = 0 [deferred] = 0 ) [1] = Array ( [Department] = SSG [Occurrences] = 1 [percentage resets of completed] = [completed] = 0 [In Progress] = 1 [Waiting for Parts] = 0 [deferred] = 0 ) [2] = Array ( [Department] = Lobby [Occurrences] = 2 [percentage resets of completed] = 0.00 [completed] = 1 [In Progress] = 1 [Waiting for Parts] = 0 [deferred] = 0 ) [3] = Array ( [Department] = BTGallery [Occurrences] = 10 [percentage resets of completed] = 44.44 [completed] = 9 [In Progress] = 1 [Waiting for Parts] = 0 [deferred] = 0 ) [4] = Array ( [Department] = Temp [Occurrences] = 15 [percentage resets of completed] = 53.85 [completed] = 13 [In Progress] = 2 [Waiting for Parts] = 0 [deferred] = 0 ) [5] = Array ( [Department] = KidZone [Occurrences] = 16 [percentage resets of completed] = 0.00 [completed] = 11 [In Progress] = 5 [Waiting for Parts] = 0 [deferred] = 0 ) [6] = Array ( [Department] = WWC [Occurrences] = 16 [percentage resets of completed] = 35.71 [completed] = 14 [In Progress] = 1 [Waiting for Parts] = 1 [deferred] = 0 ) [7] = Array ( [Department] = BodyWatch [Occurrences] = 38 [percentage resets of completed] = 51.72 [completed] = 29 [In Progress] = 8 [Waiting for Parts] = 1 [deferred] = 0 ) [8] = Array ( [Department] = TimeZone [Occurrences] = 70 [percentage resets of completed] = 66.67 [completed] = 60 [In Progress] = 9 [Waiting for Parts] = 0 [deferred] = 1 ) [9] = Array ( [Occurrences] = 169 [percentage resets of completed] = 51.45 [Completed] = 138 [In Progress] = 28 [Waiting for Parts] = 2 [Deferred] = 1 ) ) what I want it as is : Array ( [0] = Array ( [Department] = IMAX [Occurrences] = 1 [completed] = 1 ) [1] = Array ( [Department] = SSG [Occurrences] = 1 [In Progress] = 1 ) [2] = Array ( [Department] = Lobby [Occurrences] = 2 [completed] = 1 [In Progress] = 1 ) [3] = Array ( [Department] = BTGallery [Occurrences] = 10 [percentage resets of completed] = 44.44 [completed] = 9 [In Progress] = 1 ) [4] = Array ( [Department] = Temp [Occurrences] = 15 [percentage resets of completed] = 53.85 [completed] = 13 [In Progress] = 2 ) [5] = Array ( [Department] = KidZone [Occurrences] = 16 [completed] = 11 [In Progress] = 5 ) [6] = Array ( [Department] = WWC [Occurrences] = 16 [percentage resets of completed] = 35.71 [completed] = 14 [In Progress] = 1 [Waiting for Parts] = 1 ) [7] = Array ( [Department] = BodyWatch [Occurrences] = 38 [percentage resets of completed] = 51.72 [completed] = 29 [In Progress] = 8 [Waiting for Parts] = 1 ) [8] = Array ( [Department] = TimeZone [Occurrences] = 70 [percentage resets of completed] = 66.67 [completed] = 60 [In Progress] = 9 [deferred] = 1 ) [9] = Array ( [Occurrences] = 169 [percentage resets of completed] = 51.45
Re: [PHP-DB] mysql_affected_rows() question: what was changed?
Not really true, unless I learned programming in a different way ;-) I mean, if I send an update query, like update table set field1=$nfield1, field2=$nfield2 ..., I don't know WHICH fields have changed. mysql_affected_rows() only reports how many records were changed. So, if I want to know which fields have changed, I should check it before I send the query? Seems like a lot of work extra... Cpt John W. Holmes wrote: Is there a function to show WHAT fields were changed in the records, instead of only how many records were changed (with mysql_affected_rows())? I would like to report to the user which fields were altered, e.g. if he would change his phone number, to tell him: phone number changed to .. Ummm... you're creating the SQL, you should know what was updated, right? There's no function that's going to tell you this, so keep track of it as you create your query. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Really easy question
I think Jeremy means how to use it as an integer, if it is stored as a string. In this case, use $intvalue = $strvalue + 0, where $strvalue is 0, 1 and so on. Edwin Jeremy wrote: Hey folks, Im apologize that this is just a really easy general php question but any help would be appreciated. if i have a variable that is = to something like 0 or 1 but I just need it to be 0 or 1. how do i strip the off. thanks, Jeremy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Reading from file on local disk
Jan, You cannot get access to files on the client side with PHP, because there is no connection with the client. Have your client copy the file to a directory on the server, that is accessible for PHP and then read them from there. If you use unique names, e.g. workstation names, you should have no problems. Edwin Jan Meiring wrote: Hi everyone This is what I want to do: I have a file on each workstation that gets created each time the pc is rebooted - the file save the pc configuration plus the current user logged onto the machine, I want to read from that file variables so that I can save it to my mySQL database and run queries on the data. - I have no problem reading from a file if it is on the web server, but am experiencing problems reading from the file on the remote client pc. - any suggestions? This is what I can do: Read from file on web server, set it to variables and write it to a mySQL database. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Does Php support Flash files ?
What the fuck R U doing in my thread??/ Rajni Arya wrote: Hi, Does PHP supprots Flash files on Open BSD platform ? Thanks in advance. --Rajni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: MySQL and Cyrillic
You have to put these lines in your html-page: meta HTTP-EQUIV=Content-Type CONTENT=text/html; CHARSET=Windows-1252 Edwin Nikolay Nikolov wrote: Hello! I have problem with database, where have field with cyrillic char(1). I cant select by this field, because MySQL dont understand this chars as different. How can set default charset to win1251 or cp1251? I use MySQL on windows platform. Thank You! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Does Php support Flash files ?
Swearing Well, the word 'fuck' is a bit rude, but I don't think it is swearing. But I get the reactions that I was looking for :-) At 11:34 19-3-03, you wrote: Hi Edwin On Wednesday 19 March 2003 17:21, Edwin Boersma wrote: What the fuck R U doing in my thread??/ Rajni Arya wrote: Hi, Does PHP supprots Flash files on Open BSD platform ? Yes, it's rude to hijack threads. And if you search the archives, I often berate people for doing so. BUT there's absolutely no need and no place for swearing on a public forum such as this list. regards -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* When the going gets weird, the weird turn pro. -- Hunter S. Thompson */ Edwin Boersma *** Odos Agiou Polykarpou 84 300 Chora, NAXOS Greece T: +30/2285029088 O: +30/2285029093 M: +30/6942250095 E: [EMAIL PROTECTED] W: http://www.cyclades-info.com ICQ: 7383148 *** -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: sorting results in PHP
What about making an array with dates, that you compiled from Year, Month, Date using mktime(), and sort that? Edwin Bill wrote: I have a query that returns results including the fields Year, Month, and Day that I want to sort by date. Because of the nature of the query (it includes a GROUP BY statement), I cannot sort it in the query. How can I sort the results? I tried to use asort() while designating the field but that didn't work. while ($crow=mysql_fetch_array($cresult)) { $therow[]=$crow; } asort($therow[Year]); reset($therow); asort($therow[Month]); reset($therow); asort($therow[Day]); reset($therow); ideas? kind regards, bill -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Define()
Where is the $-sign in front of the vars??? Edwin Jonathan Villa wrote: Jim, I don't think that matters. One can escape into PHP in several ways (depending on the php.ini config of course) 1. ?php 2. ? 3. script language=php 4. % 5. ?= (to echo something right away) Anyway, I tried that and it still doesn't work. --- Jonathan -Original Message- From: Jim Hunter [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:59 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Define() Looking at your source you are still missing the php in the script. it has to look like: form action=?php echo CTL_HOME_ROOT ? method=POST note the php ||| add this and try it again. Jim -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql_affected_rows() question: what was changed?
Hi, Is there a function to show WHAT fields were changed in the records, instead of only how many records were changed (with mysql_affected_rows())? I would like to report to the user which fields were altered, e.g. if he would change his phone number, to tell him: phone number changed to .. Edwin -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Where have my errors gone?
Hi, Alex Francis [EMAIL PROTECTED] wrote: Got it . My ISP had upgraded PHP and left error reporting off. They have now fixed it for me. Great! But I think you'd have had the same effect if instead of this: I have tried adding error_reporting=E_ALL; to the page, but still no errors. you've used something like this: error_reporting (E_ALL); More info here: http://www.php.net/manual/en/function.error-reporting.php - E __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php, mssql and french accents
Your code page setting might be wrong. Edwin Benjamin Masdoua wrote: Hello, I'm developping an application using php and mssql. I have problems with french accents, when I insert something from php, and i consult it by enterprise manager (sql server) the accents are replaced, example paté becomes patÚ and if I insert something from enterprise manager and get teh value by php, the accents are also replaced and not by the same as the first situation example : paté becomes pat, any idea ? Benjamin Masdoua ABS-Integration Toulouse. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Problem
Does not sound like a PHP problem to me, more like IIS. Try and find some system messages that relate to the link between the servers. Edwin Kiswa wrote: Ok here is the problem. At home i run an Apache server with php4 and the server its supposed to be run on is NT5 and iis with php4 The site is run on an access db through ODBC. It works fine at home where i have a system link to the db. On the iis server the admin created the same link but the damed thing doesent work. any suggestions would be great. I dont know if there is any difference. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Need help with php and apache
Post this message to php.install. Stephen K Knight wrote: I am currently running on a Windows Box the OS is ME I have installed apache 2.0.44 and I have downloaded the newest PHP download for windows. I have read the configuration manual repeatedly for getting the php into the apache httpd.conf doc file. but I still cannot get php to be recognized. Can anyone help me with this? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql - first element missing
Therefor, add a mysql_data_seek($this-result,0) to reset the pointer. Furthermore, instead of the for-next loop, I would use while ($row = mysql_fetch_row($this-result). Edwin Foong wrote: i guess the problem is the last line of your Query function: $this-ligne = @mysql_fetch_row($this-result); this line fetch the first row of the result. therefore, when you call afficheResultatRequete(...) you start from the second row of the result. Foong F.Collineau [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I try to display the result of a mysql request but first element misses ! here is my code: $sql-Query(select marque, reference from base ); $sql-afficheResultatRequete($sql-result,$sql-nbreChamps); function Query ($query) { $this-result = @mysql_query($query, $this-id) or MySQL_ErrorMsg (Impossible de lancer la requete: $query); $this-rows = @mysql_num_rows($this-result); $this-nbreChamps = @mysql_num_fields($this-result); $this-ligne = @mysql_fetch_row($this-result); } function afficheResultatRequete($result,$nbChamps) { for($i=0 ; $row=mysql_fetch_row($result);++$i) { print(tr); $this-color_tab($i); for($j=0;$j$nbChamps;$j++) { print td; print((string)$row[$j]); /td\n; } print /tr; } } Whet is the problem ? Thanks Franck -- Faites un voeu et puis Voila ! www.voila.fr -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: subtracting times
I see 2 replies Edwin David Rice wrote: I know I asked this before buy no-one gave me an answer i was looking for, I want to subtract two times and the ammount of hours worked to 2decimal places (3.41 hours) cheers, dave _ Use MSN Messenger to send music and pics to your friends http://messenger.msn.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: font options
add some html: echo font family= color= size..., or use a style sheet where you define a DIV. Then echo div [class=...]. At the end of your echo, don't forget to close the tag. Edwin Addison Ellis wrote: hello, what is the proper way to get a block of echoes to echo with the same font, size, color, etc... as in: ? echo $row-property_type; ? ? echo $row-bedrooms; ? ? echo $row-baths; ? ? echo $row-description; ? ? echo $row-distance; ? ? echo $row-date_available; ? ? echo $row-price; ? ? echo $row-contact; ? thank you and best regards, addison -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: to connect access mdb
Sorry, I wasn't looking good and sent the post too fast :-( I have these strange reactions on M$ stuff. Micah Stevens wrote: looks like PHP to me. COM connections to Access only handle a few connections at a time. The use of a real DB server is reccommended in your situation.i Edwin Boersma wrote: To: [EMAIL PROTECTED] Date: Sat, 01 Feb 2003 18:41:49 +0200 From: Edwin Boersma [EMAIL PROTECTED] Subject: [PHP-DB] Re: to connect access mdb Use the correct ng for your problems. this is for PHP, not ASP. Qt wrote: Dear Sirs, I try to connect my access mdb with following script but I can not succed. I get following error. This server is currently overloaded - please try again later Any idea where is the my mistake. I am using xitami server under windows 98. ? $conn = new COM(ADODB.Connection) or die(Cannot start ADO); // Microsoft Access connection string. $conn-Open(Provider=Microsoft,.Jet.OLEDB.4.0; Data Source=C:\\Xitami\\webpages\\sigorta.mdb); // SQL statement to build recordset. $rs = $conn-Execute(SELECT ad FROM baydar); echo pBelow is a list of values in the MYDB.MDB database, MYABLE table, MYFIELD field./p; // Display all the values in the records set while (!$rs-EOF) { $fv = $rs-Fields(ad); echo Value: .$fv-value.br\n; $rs-MoveNext(); } $rs-Close(); ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: list menu
You mean, with font? For this, you need a style sheet, or at least style entry in 'select', like this: select style='font-family: ...; font-size: ...;' name=property, etc. See http://www.w3.org/Style/ for more info on styles. BTW: if the values are the same a what you are displaying, you don't need value=. Edwin Addison Ellis wrote: hi and thank you for your time... how do i, as my text fields are echoing a selected value, get my list menus to do the same? text field has: ? echo $arow-contact; ? list menu has: select name=property option value=? echo $row-property_type; ? selected ? echo $row-property_type; ? /option option value=househouse/option option value=condocondo/option option value=duplexduplex/option option value=apartmentapartment/option option value=landland/option /select thank you again, addison ellis -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: passing variables through frames
It's better to use input type=hidden name=... value..., because my experience is that it does not work with passing them in the action-option of form. This is the case if u have other input boxes, at least I think it is. If u don't have other input fields, just use a href=url.php?var1= etc. Edwin Matt wrote: It basically just looked something like this: form method='POST' action='url.php?var1=$var1var2=$var2' You just post the variables you want to pass throught the url string. It is pretty simple. Stefan Panayotov [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... And how does it work? -- Matt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Nevermind everyone... I found out. Thanks Matt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone know how to pass a variable to a different frame? For example, I have a navigation frame, and when you click a link, it opens inside a different frame. Can anyone tell me if there is a way to pass variables from the navigation frame to the main frame? Thanks a lot. Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: to connect access mdb
Use the correct ng for your problems. this is for PHP, not ASP. Qt wrote: Dear Sirs, I try to connect my access mdb with following script but I can not succed. I get following error. This server is currently overloaded - please try again later Any idea where is the my mistake. I am using xitami server under windows 98. ? $conn = new COM(ADODB.Connection) or die(Cannot start ADO); // Microsoft Access connection string. $conn-Open(Provider=Microsoft,.Jet.OLEDB.4.0; Data Source=C:\\Xitami\\webpages\\sigorta.mdb); // SQL statement to build recordset. $rs = $conn-Execute(SELECT ad FROM baydar); echo pBelow is a list of values in the MYDB.MDB database, MYABLE table, MYFIELD field./p; // Display all the values in the records set while (!$rs-EOF) { $fv = $rs-Fields(ad); echo Value: .$fv-value.br\n; $rs-MoveNext(); } $rs-Close(); ? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL result resource
Agree fully Try this: $query = select * from category where id=$scrow-category; $result = mysql_query($query) or die( mysql_error() ); If your query fails, and u still can't find the reason from the information that mysql_error() give you, put a echo $query inbetween to see which string your passing to mysql_query(). Edwin John W. Holmes wrote: It means your query failed... it always means your query failed for some reason (unless you typo a variable name...). Learn to use mysql_error() in conjunction with mysql_query(). Also, like I said before, mysql_db_query() is depreciated, you should be using mysql_query(). ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Addison Ellis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 10:02 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] MySQL result resource hello, i have a new issue... :-) i am getting: Warning: Supplied argument is not a valid MySQL result resource in /users/infoserv/web/register/ca/admin/catads.php on line 54 from: ? while($row = mysql_fetch_object($obj)) { $scobj = mysql_db_query($dbname,select * from subcategory where id=$row-subcategory); $scrow = mysql_fetch_object($scobj); $cobj = mysql_db_query($dbname,select * from category where id=$scrow-category);//54 $crow = mysql_fetch_object($cobj); ? any ideas, of course, are most appreciated. thank you and best, addison -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] REVISED; need INSERT help
What about using a form identifier? In each form, use input type=hidden name=formident value=form1 and so on. Then, use: switch ($formident) { case form1: your action for this form break; case form2: and so on. Edwin Mark wrote: I haven't been following any other threads relating to this, but you might try the following. It's not a recommended way to do things, as you can't verify the fields being posted, but it should work. I am assuming there is no correlation between the various forms being submitted. ? // initialize the variables contaning the lists of fields and values $ins_fields= $ins_vals= // build the strings containng the fields and values foreach($HTTP_POST_VARS as $key=$val) { $ins_fields.=$key,; $ins_vals.='$val',; } // strip off the last comma $ins_fields=substr($ins_fields,0,-1) $ins_vals=substr($ins_vals,0,-1) $query=insert into ads ($ins_fields) VALUES ($ins_vals); $result=mysql_query($query) or die(Could not insert values); ? --- Addison Ellis [EMAIL PROTECTED] wrote: hello again and i am sorry i was not more specififc in my last post. here is where i am confused: else { $today = date(Y-m-d h:m:s); $sql = INSERT INTO ads () VALUES ('$first_name','$last_name','$email','$phone','$univ_status', '$password','$today'); mysql_query($sql); $auth=yes; $logname = $email; for the actual insert, what do i put in order to avoid having to do a separate .php for each form and list the fields/values from each form? thanks and sorry again. addison previous post: hello, can someone help me with this? i have tried all i know and i am very new at this... my apologies. i am trying to have multiple forms, all with different fields/values, point to one .php that will foreach($HTTP_POST_VARS as $key = $VALUE) 1) check for if ($value == ) 2) ereg function 3) $$key = strip_tags(trim($value)); 4) $today = date(-m-d); 5) $sql = INSERT INTO tablename ($HTTP_POST_VARS) VALUES ('$$HTTP_POST_VARS values'); mysql_query($sql); the problem i am having is i have so many different form fields/values. i am almost resigning to having one .php for each form but i know there is a better way. and... anyway... thanks for looking at this. best regards, addison -- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 [EMAIL PROTECTED] [EMAIL PROTECTED] subsidiaries of small independent publishing co. [EMAIL PROTECTED] [EMAIL PROTECTED] = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a right unless you are willing to fight to death to defend everyone else's right to the same thing. -Stolen from the now-defunct Randy's Random mailing list. *** __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Parsing html entities to javascript
Hello, I store Greek characters in my db. In previous versions of php, they were stored as some characters, based on the character page. But now, they are stored as html entities. And now I have a problem, because some of the stored data is parsed to javascript. And that does not know the entities (and html at all), and thus displays them as they are, e.g. 913;954;. How can I use php to solve this? I tried unescaping and so, but without result. Or can I tell PHP to store the characters as it did before? Greetz, Edwin Boersma Naxos, GR -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: How to Make a Pop Up Window and show there a mysql table?
I use this: function CopyValue(ChangeWhat,ValueToCopy,aForm) { changer = window.opener.document.+ aForm + . + ChangeWhat + .value=' + ValueToCopy.toUpperCase() + '; eval(changer); submitme = window.opener.document. + aForm + .submit(); eval(submitme); window.close(); } Important is the first 2 lines, about the 'changer'. The other line will automatically submit the form. I think you don't want this. In the help window (with your list of codes and descriptions), put this in each option: a href=javascript:CopyValue('ChangeWhat','Value','FormName') Code description /a where: ChangeWhat is the name of the field in the form Value is what you want to put there FormName is the name of the form For an example, see my website http://www.cyclades-info.com. Press the question mark in the search form. If you need more help, mail me. Regards, Edwin José Luis wrote: I need know if 's possible show a mysql table like when you are entering some code product, you press an icon with ? (by example) and there appear the window showing the table with the code and the description and the you choose and pick some item from that table and the code pass to the input field, I saw this on asp but I think there it's possible create some on php with javascript, I am not sure what is the name of this technic. Thanks Regards José Luis Palacios Vergara -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] printing an array
Hello, Chris Grigor [EMAIL PROTECTED] wrote: Hey there all Im sure that someone out there can answer this question.. I have a problem, how can I print each element in an array so that is returned into a table? First, make sure that you have your tr/tr's in the proper places. Then, make sure that you include in your query the column(s) that you want to print. It looks like you missed these two (at least) ;) - E ...[snip]... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PostgreSQL and HTML output
With psql you can get all your output in HTML format. Anyone know of a way to do this in PHP? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL to Email and Line Breaks
Hiya, If I remember correctly, you much send both \r and \n to terminate a line on an e-mail, regardless of the platform. This should include the header aswell. At 12:00 14/04/2002 +0100, DL Neil wrote: Jeff, I have a form where someone enters the body of an email message into a textarea part of a form to be sent out to a list. Then a script retrieves the body and sends it via email. However I can't get line breaks to show up (I'm using MS Outlook) even if I enter the \n into the textarea form and those \n show up in the database data. I must be missing something. Thanks for any help. Line Breaks across different OpSys: *nix: newline character Mac: carriage return character Windows: both CR and LF LF = Newline/Line Break/Line Feed = ASCII chr(10) CR = Carriage Return = ASCII chr(13) Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] convert yyyy/mm/dd to mm/dd/yyyy, how?
Hiya, Personally, I use the following bit of code. All it does is take a 14 digit timestamp and convert it into a unix timestamp: function date($date) { //Extract the parts from the date $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); $hour = substr($date, 8, 2); $min = substr($date, 10, 2); $sec = substr($date, 10, 2); //return the unix timestamp for the date passed return (gmmktime($hour, $min, $sec, $month, $day, $year)); } From then on, you can use the date function in PHP to manage the date. There are also ways to do it using the SQL command (DATE_FORMATE() I think is one), but you'll have to read the manual for into on that. At 20:56 13/01/2002 +0100, Sander Peters wrote: Hello everybody, convert /mm/dd to mm/dd/, how? MYSQL does everything in /mm/dd. I live in the Netherlands and we are use to the format dd/mm/. What's the best way to display it as mm/dd/ in a table on a query? My first idea whas to split the date up in vars in php and then print the vars in the way I like it Is this a bad idea? Or are there better sollutions? Thanx in advance for answering! -- Met vriendelijke groet / With Greetings, Sander Peters site: http://www.visionnet.nl/ email: mailto:[EMAIL PROTECTED] webmail: mailto:[EMAIL PROTECTED] -- PHP General 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] // Jonathan Wright // [EMAIL PROTECTED] // GCS d- s: a-- C++(+) US P+++ L+ E W+++ !N w !O M- V- PS+@ PE+ //Y PGP t+ !5 X R- tv(-) b(+) DI D+(++) G h-- r-- z--(++) -- 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]