W
|
wildwally 10/29/2012 |
From the sounds of what your wanting to do this will require hand coding. |
![]() |
khalil author 10/29/2012 |
Thank you wildwally ! that was very helpful, I was just wondering what the "Custom Files" are for, I'll give it a shot now! |
![]() |
khalil author 10/29/2012 |
From the sounds of what your wanting to do this will require hand coding. If your using 6.2 in the visual editor at the bottom of the menu is a section called custom files. you can create the page outside of PHPRunner and import or you can write you code within the confines of the editor. Then create a custom link or navigation to the newely created page.
|
![]() |
Admin 10/29/2012 |
I guess you need to rephrase your question then. You specifically asked about adding static pages. |
![]() |
khalil author 10/29/2012 |
I guess you need to rephrase your question then. You specifically asked about adding static pages.
|
S
|
scoobysteve 10/29/2012 |
Hello All! I just purchased PHPRunner and I'm trying to understand how things work! so excuse me if my question sound silly! So far I'm totally impressed with PHPRunner, I can't believe the amount of work it's reducing ! I have a question though, I'm trying to create a test website, and I'm stuck somewhere: what would be the best way to add a static page? For example, let's say the landing page of the site, I want to display some news from the news table, newest users from the users table, a few static texts from Pages table etc... I tried to custom views, but they're all depending on a table, is there a way to create a static page? even if it's not within the application, I can code what I need, but I need some guidelines. Thanks in advance ! Khalil
|
![]() |
khalil author 10/29/2012 |
Khalil, I have used this php code on my home page which is outside of PHPR, I use these snippets for each field I want the latest entry to be seen as. This is assuming your using a MySQL database. Steve <?php $con = mysql_connect(""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("[color="#8B0000"]DatabaseName", $con); $result = mysql_query("SELECT * FROM DESC"); while($row = mysql_fetch_array($result)) { echo $row['[color="#8B0000"]LatestNews']; } mysql_close($con); ?>
|
![]() |
khalil author 10/29/2012 |
Hello! |
S
|
scoobysteve 10/31/2012 |
Hello! To all those who are wondering about adding dashboards or landing pages that connect to multiple pages here's the solution I came up with, same concept as Steve's method but this one keeps the code tighter without opening an extra connection to MySQL. (PHPRunner 6.2) 1- In the custom files under Editor, insert a new file or create a new file from the application editor 2- Make sure the design you want is there in HTML as a first step and make sure the extension of the file is PHP 3- on top of the file add the following code: <?php include("include/dbcommon.php"); ?> now we have the db class present and ready for us to use. 4- Execute any Query using the DB Class object, below is an example: <?php $sql = "select * from users"; $rs = CustomQuery($sql); $data = db_fetch_array($rs); print_r($data); ?> If anybody knows any easier way to establish that feel free to correct me! Cheers and thank you all for your help !
|
![]() |
khalil author 10/31/2012 |
Khalil, Nice one, I like it, I have a question for you if I only wanted to display 1 value from one field called ScreenName how do I change the code below to show just that instead of the whole sql data. Thanks Steve <?php $sql = "select * from users"; $rs = CustomQuery($sql); $data = db_fetch_array($rs); print_r($data); ?>
|
S
|
scoobysteve 10/31/2012 |
Hello Steve, If you want to select a specific field in the table row, you can simply replace "" with the field name, like below: SELECT username FROM users ;If you want to select a specific row from the table, you need to provide its ID, for example, if you want to display a user with the ID of 1, you can use this: $sql = "SELECT FROM users WHERE users.id = 1"; You can always add "LIMIT" to your sql statement to limit the results... in the code you provided it would be: $sql = "select * from users limit 1"; Hope this helps! Cheers Khalil
|