Re: [PHP-DB] Getting database output into another frame in another window

2002-12-17 Thread Wico de Leeuw
At 11:06 17-12-02 +, Chris Jewell wrote:

The name specified in (2) is maindb.queryframe.  I have a frame defined as
FRAME NAME=queryframe in the maindb window.  Still not working :(


The names has to match, so either you specify target=queryframe in the 
form or do
FRAME NAME=maindb.queryframe

Gr,

Wico

On Tuesday 17 December 2002 11:04, you wrote:
 At 10:59 17-12-02 +, you wrote:
 Hi,
 
 I've got a set up where I would like my query output to appear in a frame
 in a
 main window.  Since my queries require stepwise user input, they are going
  to be built up in a pop-up window.  When the query form (in the popup) is
  sent, it calls a php script which drags the data out of a Postgresql
  database. However, I then want the query results to be sent to the frame
  in the main (parent with respect to the pop-up) window.  How do I acheive
  this?  Things I have tried are:
 
 1. Putting FORM ACTION=opener.location.replace('query.php')
  METHOD=GET
 
 2. Naming the main window with BODY onLoad=window.name='maindb' then
 putting FORM ACTION=query.php TARGET=maindb.queryframe METHOD=GET
 
 Number (1) opens query.php in the correct location (ie the frame in the
  main page) but does not pass the form data to the server.  Number (2)
  passes the form data to the server, but the results appear in a new
  window.  ARGH!
 
 Any ideas?

 For number 2 the name has to match the name you defined in the frame tag
 (if you use frames)

 Chris J
 
 --
 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Wico de Leeuw
At 23:38 17-12-02 +1000, Bruce Levick wrote:

Bruce Levick - Vivamotion
Been searching for an answer to selecting a random table and then a random
row within the selected table.

I have this code which successfully selects a random row within a hard coded
table. But just can't get the random table working.

?php
//trying to select all tables from the database portfoliopfff
 $alltables = mysql_list_tables(portfolio);

//trying to get the array value of the alltables...there are 4 tables in the
database. So as far as I know the value of $alltables should be 3. (0table,
1table, 2table, 3table)
 $randtabnum = array($alltables);


 $randomtabel = array_rand($alltables);




// this selects everything from the Illustrations table. I need to make the
FROM table_name a random selection
 $all = mysql_query(SELECT * FROM Illustrations);

//acquires total rows
 $totalRows_Recordset1 = mysql_num_rows($all);

// selects random row from total rows
$rndm = mysql_query(SELECT * FROM Illustrations ORDER BY RAND() LIMIT
4,$totalRows_Recordset1);
 if (!$rndm) {
  echo(PError performing query:  .
   mysql_error() . /P);
  exit();
}

 $randrow = mysql_fetch_array($rndm);
 ?

Anybody see the solution??

Winxp Pro, php 4.2.2 Mysql 3.2

Cheers


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