Page 1 of 1

Possibility to pull any code anywhere

Posted: 2014-02-13 10:46
by bambinou
Hi,

I have seen a lot of great bootstrap templates on the internet, the problem is that they are front end user templates and not backend like what AppGini uses.
Will you one day include a way of letting us pull any type of data from mysql to any front end templates we wish to use.

For example, let's say I upload a picture in the back end but wish to see that same exact picture in my new front end template, at the moment you have code your own code, but having something to copy and paste from the back end on the front end layout would have been fantastic.

It could be some text, pictures and more.


Thanks,

Ben

Re: Possibility to pull any code anywhere

Posted: 2014-02-15 15:33
by a.gneady
Let's assume that your generated AppGini application is at http://website.com/backend while your front-end code is in the folder above it ... that is, http://website.com ... You could try something like this in your front-end scripts:

Code: Select all

<?php
	$appgini_dir = dirname(__FILE__) . '/backend';
	include_once("$appgini_dir/defaultLang.php");
	include_once("appgini_dir/language.php");
	include_once("appgini_dir/lib.php");

	/* query to obtain your requested data */
	$res = sql("select * from customers where customer_id='455'"; $o);
	$data = mysql_fetch_row($res);

	/*
		You can now use variables like $data['customer_name'] inside your page code
		where "customer_name" is an example field name ... it would be replaced by
		actual values from the database ...
	*/

?>
Or if the rest of your page is HTML code .. you can insert the data values into it like this:

Code: Select all

<?php echo $data['customer_name']; ?>

Re: Possibility to pull any code anywhere

Posted: 2014-02-15 15:38
by bambinou
Hi Ahamad,

Thank you so much.
It would be great to have this in your tutorials on your website because this is a very useful part of making appgini working well with front end designs.

Ben

Re: Possibility to pull any code anywhere

Posted: 2014-02-15 15:41
by bambinou
Also, I have just noticed, AppGini do not use Mysqli?
mysql is deprecated no?

Thank you,

Ben

Re: Possibility to pull any code anywhere

Posted: 2014-02-15 15:47
by a.gneady
Yes, I'll add mysqli support in future releases.

Re: Possibility to pull any code anywhere

Posted: 2014-08-10 03:38
by isonewiner
Hello how can you pull tha code like this example making a list result using pagination

SELECT id,name,image,category FROM table WHERE id = %s ORDER BY RAND ()