Jump to content

Really need help! Is probably a simple answer!


cristo33

Recommended Posts

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);

 

 

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");

?>

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.