Big12inch Posted January 24, 2007 Share Posted January 24, 2007 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 More sharing options...
simcoweb Posted January 24, 2007 Share Posted January 24, 2007 Maybe I don't quite get where your problem is...but since you're using the SELECT * FROM query that summons everything from that table into an array. Therefore you can use that data in a couple ways like perhaps a while loop. Link to comment https://forums.phpfreaks.com/topic/35456-php-query-question/#findComment-167856 Share on other sites More sharing options...
Big12inch Posted January 24, 2007 Author Share Posted January 24, 2007 i want to take this sql query$config["template"] = $misc->make_db_unsafe($recordSet->fields["controlpanel_template"]);and reference the above record that is circledi 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.