Jump to content

Php query question


Big12inch

Recommended Posts

I am doing a hack for Open realty, i want to be able to choose a different template for each listing..

i dont know how to change the call to the database so that it uses my new field that i made...

here is the code..
config file
$config = array();
global $config;
global $db_type;
$db_type = "mysql";
$db_user = "xxxxxxxxx";
$db_password = "xxxxxxxx";
$db_database = "xxxxxxx";
$db_server = "xxxxxxx";
$config["table_prefix_no_lang"] = "default_";
// this is the setup for the ADODB library
include_once("/data/11/1/79/130/1079293/user/1120773/htdocs/open/include/class/adodb/adodb.inc.php");
include_once("/data/11/1/79/130/1079293/user/1120773/htdocs/open/include/misc.inc.php");
$misc = new misc();
$conn = &ADONewConnection($db_type);
$conn->PConnect($db_server, $db_user, $db_password, $db_database);
$sql = "SELECT * FROM ".$config["table_prefix_no_lang"]."controlpanel";
$recordSet = $conn->Execute($sql);
if (!$recordSet)
{
echo "ERROR: ".$sql;
}
// Loop throught Control Panel and save to Array
[color=red]$config["template"] = $misc->make_db_unsafe($recordSet->fields["controlpanel_template"]);[/color]


the location of the field i need to grab the data from is in the picture below

[img]http://www.acadiananeighborhoods.com/images/help.jpg[/img]
Link to comment
https://forums.phpfreaks.com/topic/35456-php-query-question/
Share on other sites

i want to take this sql query
$config["template"] = $misc->make_db_unsafe($recordSet->fields["controlpanel_template"]);

and reference the above record that is circled

i dont know how to use the select * from statement..  i can read, modify, fix, but i cant write code. i am not to that level yet
Link to comment
https://forums.phpfreaks.com/topic/35456-php-query-question/#findComment-168079
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.