cristo33 Posted April 9, 2007 Share Posted April 9, 2007 a friend has asked me to link their mysql database to a script that they found which allows products and things to be rated. i foolishly said that i would, thinking that the knowledge i had of php a few years ago would come back. it hasnt. i was was wondering if any one could tell me if there is anything wrong with the following? i realise that it is probably an unbelievably simple answer! <? /******************************/ /* rateit.php */ /* author: [email protected] */ /* 23.Maj, 2003 */ /* http://www.skintech.org */ /******************************/ $username = "reviewsstars"; $password = "**********"; $database = "p50mysql31.secureserver.net"; $table = "ratings"; $days = 1; $m = 20; $C = 6; @mysql_connect(" I AM NOT SURE WHAT TO PUT HERE?",$username,$password); @mysql_select_db($database); Link to comment https://forums.phpfreaks.com/topic/46218-really-need-help-is-probably-a-simple-answer/ Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 heres a basic routine your need to sortout the SQL yourself <?php $db = "databse"; $host = "localhost"; $user = "user"; $pass = "pass"; $id = @mysql_pconnect($host, $user, $pass) or MySQL_ErrorMsg("Unable to connect to MySQL server: $host : '$SERVER_NAME'"); @mysql_select_db($db, $id) or MySQL_ErrorMsg ("Unable to select database: $db"); $query = "UPDATE table SET `col` = '$value' WHERE `ID` =1 LIMIT 1 ;"; $result = @mysql_query($query, $id) or MySQL_ErrorMsg ("Unable to perform insert: $query"); ?> Link to comment https://forums.phpfreaks.com/topic/46218-really-need-help-is-probably-a-simple-answer/#findComment-224708 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.