[PHP-DB] Re: mysql results, arrays, and for loops

2004-06-13 Thread franciccio
Hi, here is my solution (one of the possible) it is tested so it should work fine: \n"; $record= mysql_fetch_array($recordset, MYSQL_ASSOC); foreach ($record as $k =>$val) { echo "$k\n"; // print the field name in the first row of the table for ($i=0;$i<$num_righe;$i++) { echo

[PHP-DB] Re: how to reuse DB results

2004-06-13 Thread franciccio
Sorry for mystakes, (shame on me, i said i was new) using Object array, here is a working version (tested) with use of array. Bye $recordset=mysql_query('SELECT * FROM my_tabella'); // or whatever query is /* define an array with fields to be shown on top of page. Attention ...values name mu

[PHP-DB] Re: Retrieve data from a table, edit/add it and enter it in a new table

2004-06-13 Thread franciccio
I see one bug in your code , that is you never "rewind" the pointer of mysql_fetch_array($result), so at the end of the first cycle ...while ($r=mysq...)... the pointer is at the end of the query resource. You should use mysql_data_seek($result,0) to rewind before doing another while cycle. Hope it

Re: [PHP-DB] Re: HTTP header information

2004-06-13 Thread franciccio
You may try with this: // then here is all the html for that page Bye Basile Francesco "Philip Thompson" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > > On Jun 10, 2004, at 9:44 AM, Torsten Roehr wrote: > > > "Philip Thompson" <[EMAIL PROTECTED]> wrote in message >

[PHP-DB] Re: how to reuse DB results

2004-06-13 Thread franciccio
Hi here is my logic, i haven't tested but it should work (i hope)!!! i'm not sure if it works only on php5...!?! Let me know if it is a complete crap i've just started learning php. Bye $recordset=mysql_query($query); // whatever query is $obj_array=new ArrayObject($recordset); // get the iterato

Re: [PHP-DB] Mysql not receiving the data

2004-06-13 Thread franciccio
I agree, the slashes are killing the query. I would suggets doing this: $add = "INSERT INTO movies SET > movie_name=\"$movie_name\", > genre=\"$genre\", > director=\"$director\", > star1=\"$star1\", > star2=\"$star2\", > star3=\"$star3\", >

[PHP-DB] Re: Problem in passing the necessary variable.

2004-06-13 Thread franciccio
Ciao..hi, i would suggest to embed the html code in php like this: "; ?> If it works let me know , bye Francesco Basile __ "Alessandro Folghera" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi, > > I ha

Re: [PHP-DB] Mysql not receiving the data

2004-06-13 Thread franciccio
Lellelid" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi Andrew, > > Andrew Rothwell wrote: > > Thank you everybody that responded so quickly - > > I used the suggestion of Franciccio - and the data is now gow into the db > > Thank you very m

[PHP-DB] Re: Pass into the title meta-tag a variable from an URL Directory Manager

2004-06-14 Thread franciccio
Wathever you are ging to do with meta tag they still are html tag, so as long as you embend the tag in php code it shuold just work fine. "; ?> Any text editor should help you modifying the code by "find & replace" tools. Hope can help ps. FORZA ITALIA AG

[PHP-DB] Re: anonymous select error

2004-06-15 Thread franciccio
Here is the lean, corrected code: '; mysql_select_db( $dbname, $link) or die ("eror selecting db"); echo 'selected db ok'; $result = mysql_query( 'Select * From newsletter_subscribers',$link) or die ("error query"); // some here code to disply result ?> It is easier to evaluate each time the return

[PHP-DB] Re: Erroneous date and time

2004-06-16 Thread franciccio
Have you tried with "a" insted of "A" for am/pm indication? Hope can help Bye Franciccio "Philip Thompson" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > Hi all. > > Maybe there's something I'm doing incorrectl

[PHP-DB] Re: [PHP] update count

2004-06-16 Thread franciccio
I don't think you can have a relation (table) without a unique key. Either a single field or a unique relation between 2 or more fields is necessary for the table. Franciccio "Bob Lockie" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > On 06/16/04

[PHP-DB] Re: MySQL: Random select with specific count of a column

2004-06-30 Thread franciccio
I suggest to first analize the problem and then go through the query, php coding ...etc etc In the table u have only one superkey which is also a key and it is made of the three fields (attributes) 'category', 'language' and ' name'. You should consider to look for a prymary key randomly, togheth

Re: [PHP-DB] LEFT joins

2005-01-20 Thread franciccio
Jochem Maas ha scritto: Han wrote: Hmm, still no luck. Thanks for the help. I think I'll have to break the you mean that it still times out? crashes mysql? maybe the table (tc_countries) is corrupt? try doing a repair. select up into 2 selects and throw the results of the first into arrays. Didn'

[PHP-DB] Re: Cannot load MySQL extension (mysql.so issues)

2005-01-20 Thread franciccio
Eve Atley ha scritto: Platform: Redhat Linux Enterprise WS 3 PHP installed: 4.3.2 MySQL installed: 4.0.21 Apache installed: 2.0.46 When setting up PhpMyAdmin today, I got the error: Cannot load mysql extension, Please check PHP configuration My phpinfo() shows: 'with-mysql=shared,/usr' (yes, the co

Re: [PHP-DB] Returns Blank

2005-01-20 Thread franciccio
Squeakypants ha scritto: From a forum that recommended this to me, I changed the query execution to this: $query = "SELECT credits FROM krypto WHERE user=$user AND pass=$pass"; echo "query = ". $query ."\n"; $result = mysql_query($query); echo "result = ". $result ."\n"; So now it outputs this: que

Re: [PHP-DB] mysql table join

2005-02-06 Thread franciccio
You may try to create a VIEW. In this case the tables will be dynamically linked, that is when some values change in both tales the views automatically update itself each time you call it. "CPT John W. Holmes" <[EMAIL PROTECTED]> ha scritto nel messaggio news:[EMAIL PROTECTED] > From: "Roger