This topic is locked

Copy one field name to another table

11/22/2018 5:05:17 PM
PHPRunner General questions
Tandy author

I have two tables boat_condition and boat_condition_images. They are linked together, Master = boat_condition and Details = boat_condition_images

both have boat_condition_id is the link field.

Then in both tables I have: field name = size_make_model

The fill out the boat_condition table first. I would like to see if I can have the boat_condition_images field of size_make_model already put in?

I know I have done the $_SESSION but this is not on the login page to add that..

Any help would be a great help..

Thank You..

Tandy author 11/22/2018

Second problem I am having is trying to take size_make_model field and have it make a folder to add the images. In my events I have in the Add page Before process this code:

$folder = "Boat Condition Images";
$directory = ($data["size_make_model"]).'/';

$folder .= $directory;



//If the directory doesn't already exists.

if(!is_dir($directory)){

//Create our directory.

mkdir($directory, 755, true);

}
$_SESSION["Folder"] = $folder;
return true;



I am trying to figure out what goes into: $directory = ($data["size_make_model"]).'/';

to get the folder name.

Tandy author 11/29/2018



Second problem I am having is trying to take size_make_model field and have it make a folder to add the images. In my events I have in the Add page Before process this code:

$folder = "Boat Condition Images";
$directory = ($data["size_make_model"]).'/';

$folder .= $directory;
//If the directory doesn't already exists.

if(!is_dir($directory)){

//Create our directory.

mkdir($directory, 755, true);

}
$_SESSION["Folder"] = $folder;
return true;



I am trying to figure out what goes into: $directory = ($data["size_make_model"]).'/';

to get the folder name.



Well never mind.. Two questions unanswered. First one just asking if it has or can be done..

Big waste of money for years. Bought a program for three years and cheaper. Does a lot more and get a few suggestions if needed..

Good luck all and take care. will not be using or upgrading my Lic again..

lefty 11/29/2018



Well never mind.. Two questions unanswered. First one just asking if it has or can be done..

Big waste of money for years. Bought a program for three years and cheaper. Does a lot more and get a few suggestions if needed..

Good luck all and take care. will not be using or upgrading my Lic again..


update;
I see your frustrated. I have been before. Did you send a ticket to support . You should always mention which version you are using also. I have a similar project setup like this with images in the details which also has to be setup as an image to view which you can make readonly ( make sure you check Details Settings list page and any other if needed). I may be missing the boat no pun intended on your question but check that the master details are setup correctly . You can make a SESSION call by making the field value set as default $_SESSION["Field1"] and so on in the fields in table Master Table , So you can make a link field to Master table view as with code $value ="<a href='YourTable_add.php?Field1=".$data["Field1"]."&Field2=".$data["Field2"]."'>Link Here</a>"; Then when you click the link all the fields in other table will be filled in on add page already . IF you really need a screenshot I will get you one, Showing something similar to what you have.





Another option : Here is a link to have images on another table filled in Add images to add page on the fly from another table then use dependent dropdowns for all pertinent fields. Although you can't use dependant dropdown in this method from image field but you can fill in dependant from the ID relationship . Hope this is what your are looking for.
As far as question 2 see My link as I don't see path here . Should be something like [size="2"]$folder = $_SERVER["DOCUMENT_ROOT"]. "/files/images";[/size]
or contact support . Haven't dealt with adding folders on the fly in which you should check php expression in file upload to make folder on the fly there instead. [size="2"] . I use windows , and it looks like you use linux as I see the 755, so not sure with linux. If you have on fly is the folder getting the permissions for read / write correctly?[/size]
If you don't get this contact support and submit a ticket. That usually is the best way to go if you can't find answers here.