[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: ?php $recordset=mysql_query($query); $num_righe=mysql_num_rows($recordset); // here starts the dinamyc table echo TABLE align=\left\ border=\1\ cellspacing=\2\ cellpadding=\2\ width=\80%\\ntr; $record=

[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

[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: ?php ob_start();/* buffer the output so no header is sent until the script is complete*/ session_start(); if (!session_is_registered('_isLoggedIn')) { header (Location:viewer.php?type=login); } else { // do the stuff to submit a problem if they have // logged in and have

[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

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: ?php $_your_variable=$row[imgid]; echo a href=\../images/image.php?img=$_your_variable\ target=\_blank\ onClick=\window.open(this.href, this.target, \'width=200,height=250\'); return false;\img

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

2004-06-13 Thread franciccio
send by GET, COOKIE method. Bye Hans 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 much

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

2004-06-14 Thread franciccio
the code by find replace tools. Hope can help ps. FORZA ITALIA AGLI EUROPEI Franciccio Alessandro Folghera [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] I hope that phpers will be not angry if I'm posting that maybe stupid question. I have the following script, an URL Directory

[PHP-DB] Re: anonymous select error

2004-06-15 Thread franciccio
Here is the lean, corrected code: ?php $link = mysql_connect( $site, $id, $pass ) or die (error connecting); echo 'connection okbr'; mysql_select_db( $dbname, $link) or die (eror selecting db); echo 'selected db ok'br; $result = mysql_query( 'Select * From newsletter_subscribers',$link) or die

[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 incorrectly, but I cannot get the date() function to return the appropriate time

[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 09:53 John Nichel spoke: Bob

[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,

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.

[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

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: query =

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