[PHP-DB] Column names into variables
Hi, I have a table with about 50 columns in it. I'd like to query the information for one record, and hold the data in variables that have the same name as the column headings, along these lines: $query = Select * from `postings` where `id` = $userid; $result = mysql_query($query); while($row=mysql_fetch_array($result)) { $id = $row[id]; $location = $row[location]; $employer = $row[employer]; ... } I'd like to do this for all columns in the table, and feel like there's a way to do this automatically, but haven't been able to find the function or syntax to use. Any help is greatly appreciated. Thanks, Zeth
[PHP-DB] xml doccument validation ?????
guyz its terrable i have a well formed xml doccument but i cant get it validated ... i keep getting this error this file is not valid. all fields referred to from the key identity constraint 'user_info_memb_id' must exist now i had made 6 tables in access but i made a schema in xml from the scratch ... no import from access u know ... and i defined all my table names as schema elements with sub elements and attributes the xml doccument is : ?xml version=1.0 encoding=UTF-8? user-info xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=F:\New Folder (2)\final project\d bs\proj_db.xsd role memb/ modrtr/ /role member memb-id/ email/ name firstName= lastName=/ login password= login=/ news-letter-subscription/ lang-id/ country/ /member /user-info where am i messing it up oh i ve generated this thru xml spy ..if that helps . :( . will somebody plz help i'd really appriciate any help ... any word on this . stuck az usual :( toby .. __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] xml doc validation .... details ...... ! ! ! !
well its something like i need to take user input and store it somewhere and then retrieve it back thru DOM and i guess i need to store that input in an xml doccument like the one i sent earlier or do i now the thing that im most concerned bout is . this doccument or anyother that i try tomake using the scheema doesent get validated i keep getting an error fo one of the fields for each . i've tried changing the field types but ... even that doesnt change anything .. secondly i made a single scheema . and i included all the elements in it . user-info, content-info, categry,.. with all their subelements . i think im right or am i third .i have a few elements in the scheema that are repeated . do u think that cud be the problem ? so thats it ... if u want me to tell u more plz do let me know thnx a million toby __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] using a define value
I have declared some values as define statements, like: define(_ERROR1,Error: Your value is wrong, please check params); But while trying to be called based on parameter, is not possible to call them via: $myerror = ERROR1; echo strongERROR._$myerror./strong; It not works. Any suggested solution without using _ERROR1 like a variable ? -- saludos, J. Alejandro Ceballos Z. | ---+--- http://alejandro.ceballos.info | [EMAIL PROTECTED] | La persona más patética del mundo es ---+ alguien que tiene vista, pero no visión. | | -- Hellen Keller -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] using a define value
Then, is not possible to use a definition table for errors or equivalents?. It must be a variable value or a hash? I am using this for error messages after a CGI execution. That is why planning to use a code for error, and definition table show the specific message. Like http://myphppage.php?error=ERROR1; [snip...] But while trying to be called based on parameter, is not possible to call them via: $myerror = ERROR1; That would be $myerror= ERROR1; echo strongERROR._$myerror./strong; ... and that would be echo strong.ERROR.._$myerror./strong; -- saludos, J. Alejandro Ceballos Z. | ---+--- http://alejandro.ceballos.info | [EMAIL PROTECTED] | La persona más patética del ---+ mundo es alguien que tiene | vista, pero no visión. | | -- Hellen Keller -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: stuck on stupid...can't find the bloody error..
Isnt easy to use if (! $page_req) or if (strcmp($page_req,0)) instead of if ($page_req == ) or if ($page_req == 0) ? -- saludos, J. Alejandro Ceballos Z. | ---+--- http://alejandro.ceballos.info | [EMAIL PROTECTED] | Life is like a shooting star ---+ it don't matter who you are | if you only run for cover, | is a waste of time | we are lost 'til we are found | this phoenix rises up | from the ground | and all these wars are over. | |-- Live, The dolphin's cry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Printing + without encoding as %2B
While calling a php with a parameter, the plus sign is interpreted as a white space. Is any solution to prevent this in the php page, not before calling it or previously urlencoding? --- While calling http://mysite.com/mypage.php?id=29d9f+Kr2/4=otherdata=xx ?php echo id = $id; ? prints: id = 29d9f Kr2/4= -- Saludos, J. Alejandro Ceballos Z. | ---+--- http://alejandro.ceballos.info | [EMAIL PROTECTED] | ¿Cómo es posible, ---+ que mientras medio mundo Tel: (33) 3647-7809 | hace dietas para no engordar, Cel: (33) 1076-4705 | el otro medio | se muera de hambre?. | | - August -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SUMMARY: Most frequently used words
Thank you for you help, specially to Chris that gives me a clue to solve it. The solution was: // store in str_wordlist all different phrases for($i=0; $icount($arr_phrase); $arr_phrase) { $str_wordlist .= .$arr_phrase[$i]; } // store in hash_frequencywords the counting values $hash_frequencywords = array_count_values(explode(' ',trim($str_wordlist))); // descendent sort based on values arsort($hash_frequencywords); // store the 20 most frequently words $arr_20mostusedwords = array_slice(array_keys($hash_frequencywords), 0,20); IHTH, ,_, (O,O) J. Alejandro Ceballos Z. [EMAIL PROTECTED] ( ) --- http://alejandro.ceballos.infomovil: 33.1411.6079 Atentamente, Felicidad no es hacer lo que uno quiere sino querer lo que uno hace. -- Jean Paul Sartre ,_, (O,O) J. Alejandro Ceballos Z. [EMAIL PROTECTED] ( ) --- http://alejandro.ceballos.infomovil: 33.1411.6079 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: Recommended web developers
On India or China even they have good deployment and prices are lower than USA, the main problem is the time difference and the language support. We have work for diffent projects and companies, but many of our clients and friends have told me that the previous issues have them changed their focus of outsourcing. Suppose you have to call for a check or something. First, you must agree at one hour that both can answer the phone and later understand each other what are you trying to understand. And at second point, if you need to go or they need to come.. just by videoconference. Physically may be a little difficult De: A. Joseph [EMAIL PROTECTED] Fecha: 24 de junio de 2008 10:00:37 a.m. GMT-05:00 Para: Evert Lammerts [EMAIL PROTECTED] Cc: J. Hill [EMAIL PROTECTED], php-db@lists.php.net Asunto: Recommended web developers Which company in India or USA can you recommend to design a complex website for my company. The site will be a social site, will include, Blog, Articles, Shops, Music, Movie, Directory, Pre-paid card system, Culture and Tourism, downloads, file upload and sharing The site is just like yahoo, but no email service. Advert method will be like Google Ads PHP 5 MySql, Smarty, SOAP Service, Ajax, Javascript, div based, Apache with mod_rewrite Admin Area, Users area, front end Full detail will be available Planned amount is $1 Max Atentamente, Porque nadie puede saber por ti. Nadie puede crecer por ti. Nadie puede buscar por ti. Nadie puede hacer por ti lo que tú mismo debes hacer. La existencia no admite representantes. -- Jorge Bucay ,_, (O,O) J. Alejandro Ceballos Z. [EMAIL PROTECTED] ( ) --- http://alejandro.ceballos.infomovil: 33.1411.6079
[PHP-DB] Summary: recover values independently of GET or POST used
Thank you TG and Chris. Using $_REQUEST or something like $parameter = array_merge($_GET, $_POST); makes me a little noise; so preffer using extra ()'s, changing to $mydata = (isset($_GET[mydata])) ? $_GET[mydata] : ((isset($_POST[mydata])) ? $_POST[mydata] : 0); and include a little comment above. It works, thank you J. Alejandro Ceballos Z. w: http://alejandro.ceballos.info e: bu...@alejandro.ceballos.info m: +52 (33) 1411.6079
[PHP-DB] capture a webpage to later process it
I want to read the results of an URL address, to later process it and insert part of them as internal code. If I use include or require, they inserts ALL the resulting code, but I want to do something like: blah, blah, blah ?php $result_webpage = somephpfunc('http://other.sit/externalpage.html'); if (eregi(result:([:alnum:]+).*([:alnum:]+\.jpg),$result_webpage,$array_match)) { echo h2External status:.$array_match[1].brimage: img src=\..$array_match[2].\/h2; } ? blah, blah, blah TIA, ,_, (O,O) J. Alejandro Ceballos Z. [EMAIL PROTECTED] ( ) --- http://alejandro.ceballos.infomovil: (33) 3849-8936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] re: mysql ORDER BY problems
are they defined as integer or varchars (string)? try a) exchange field definition varchar / integer b) order by length(number) and later by number -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: crosstab for MS SQL
Hi, I don't think you can do that with MS SQL, it doesn't support TRASFORN, I think that's strictly Access syntax. MS SQL 7 and up does have ROLLUP etc but that's part of the OLAP service, which you will only get if you have Enterprise edition (read $$ :)). The easiest way to get out of this is to use the CASE statement. For example: CREATE TABLE Pivot ( Year SMALLINT, Quarter TINYINT, Amount DECIMAL(2,1) ) GO INSERT INTO Pivot VALUES (1990, 1, 1.1) INSERT INTO Pivot VALUES (1990, 2, 1.2) INSERT INTO Pivot VALUES (1990, 3, 1.3) INSERT INTO Pivot VALUES (1990, 4, 1.4) INSERT INTO Pivot VALUES (1991, 1, 2.1) INSERT INTO Pivot VALUES (1991, 2, 2.2) INSERT INTO Pivot VALUES (1991, 3, 2.3) INSERT INTO Pivot VALUES (1991, 4, 2.4) GO This is the SELECT statement used to create the rotated results: SELECT Year, SUM(CASE Quarter WHEN 1 THEN Amount ELSE 0 END) AS Q1, SUM(CASE Quarter WHEN 2 THEN Amount ELSE 0 END) AS Q2, SUM(CASE Quarter WHEN 3 THEN Amount ELSE 0 END) AS Q3, SUM(CASE Quarter WHEN 4 THEN Amount ELSE 0 END) AS Q4 FROM Pivot GROUP BY Year GO This will give you the result: +---+-+--+--+-+ | Year | Q1 | Q2 | Q3 | Q4 | +---+-+--+--+-+ | 1990 | 1.1 | 1.2 | 1.3 | 1.4 | +---+-+--+--+-+ | 1991 | 2.1 | 2.2 | 2.3 | 2.4 | +---+-+--+--+-+ This works with MS SQL 7 and 2000. I don't know if 6.5 supports this though :( -Original Message- From: MWCT - Markus Weber [mailto:[EMAIL PROTECTED]] Sent: Saturday, 28 December 2002 5:34 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: crosstab for MS SQL Have you tried the MS Access Syntax ? - e.g.: TRANSFORM Sum(cube_by_c.netc_bd) AS [Summe von netc_bd] SELECT cube_by_c.pthr_product_c AS PROD_C, xref_prod.pthr_desc_x AS [DESC] FROM cube_by_c LEFT JOIN xref_prod ON cube_by_c.pthr_product_c = xref_prod.pthr_product_c WHERE (((cube_by_c.country_iso3_c)=DEU)) GROUP BY cube_by_c.pthr_product_c, xref_prod.pthr_desc_x PIVOT cube_by_c.mm; regards, markus Sommai Fongnamthip [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, MySQL has a method to write Crosstab method but It can't use with MS SQL. Did someone know how to write SQL statement for make cross tab with MS SQL 6.5 (both ODBC and TDS connection)? Thank you SF -- 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] transaction locking
Hi, Aleks Kalynovych wrote: I have a couple forms that generate a unique ID based on taking the highest number in the ID column adding 1 to its value. The problem is that I dont save that number until the form is submitted. If 2 or more persons fill out the form at the same time they all get the same ID number. I hope that there are some suggestions on how to accomplish this with a better method You really should avoid using this method precisely because of the concurrency issue that will invariably happen. If you're using MySQL and your ID field is of type AUTO_INCREMENT then you can use MySQL built-in method named: LAST_INSERT_ID() or in PHP you can use a function named: mysql_insert_id() http://www.php.net/mysql_insert_id For more information visit: http://www.mysql.com/doc/en/example-AUTO_INCREMENT.html This is concurrency safe so you shouldn't have this problem in the future. HTH -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php