This topic is locked

Creating a link to the view page of another table

7/23/2009 3:29:05 PM
PHPRunner General questions
C
chinwag author

Hi
I have a table/project called 'details' with fields:
autoincrement

name

city

state
The 'city' field is dependant on the 'state' field from my 'states' table
In another project called 'information' I use the 'city' and 'state' field.
The 'autoincrement' and 'name' field are not used/shown on this 'information' project.
On the list page of this 'information' project, I would like the 'city' field entry to actually be a link to the view record page of the relevant record from the 'details' project so that the user can click on the 'city' and be taken to see the rest of the 'details' record.
So if in the city field of the 'information' project was 'Orlando'..... I want the word 'Orlando' to link to the view page of the record in the 'details' table to show all the other 3 fields.
How do I do this?

J
Jane 7/24/2009

Hi,
use custom format on the"View as" settigns dialog on the Visual Editor tab.

Here is just a sample:

global $dal;

$rs = $dal->details->Query("city='".$value."'","");

$datatmp = db_fetch_array($rs);
$value = "<a href=\"details_view.php?editid1=".$datatmp["autoincrement"]."\">".$value."</a>";

C
chinwag author 7/24/2009

Hi,

use custom format on the"View as" settigns dialog on the Visual Editor tab.

Here is just a sample:


Which files does this actually change? commonfunctions.php and what else?
and do you mean do this to the 'details' project or the 'information' project?
At the moment I have done this to the 'information' project on the relevant field and manually uploaded the list template html file and the commonfunctions.php but there is no change from previous...... I prefer to upload using a third party ftp client, so which files?
EDIT: I have applied this to the 'details' project and I get the following php error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'city='orlando'' at line 1

J
Jane 7/27/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

S
Shankar 7/27/2009

Hi,

use custom format on the"View as" settigns dialog on the Visual Editor tab.

Here is just a sample:


Hi Jane.

I copied and pasted this code exactly, save I changed details and city to my own table and field values.

I then pasted it into custom view on the master table list page. When I built the project and clicked the link(s) I got the error "No input file specified." Do I need to change something else?
Actually, what I am trying to do, is replace the details links and pop-up preview created by phprunner and move these to another field (which would be city in the above example). I would also like to make the pop-up preview clickable through to the details.
Thanks

Shankar

J
Jane 7/28/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.