‘;

echo ‘Book ISBN:’.$SLI_ISBN;

echo ‘
‘;

echo ‘Field to be bumped:’.$SLI_Bump_Field;

echo ‘
‘;

// Begin build SELECT record

$hostname = “localhost”;
$username = “Russ01”;
$password = “Sheepguy1302”;
$dbname = “SLI_Stored_Characteristics”;

mysql_connect($hostname,$username,$password) or die (‘MySQL could not connect ‘.mysql_error());

echo “MySQL connected successfully”;
echo ‘
‘;

mysql_select_db($dbname) or die (‘MySQL could not select db’);

echo “MySQL selected successfully”;
echo ‘
‘;

$selcount = 0;
$userkey = ‘T02_isbnkey’;
$usertable = ‘book_profile_table’;
$usertblpfx= ‘T02’;

// SELECT Syntax for member_profile_table

$query = (“SELECT * FROM $usertable WHERE $userkey = \”$SLI_ISBN\””);

echo ‘Userkey:’.$SLI_ISBN;
echo ‘
‘;

$result = mysql_query($query);

$selcount = mysql_num_rows($result);

echo $selcount.’ Rows’;

if ($selcount == 1)
{

echo “book profile record found. Updating page visits.”;
echo ‘
‘;

$row = mysql_fetch_assoc($result);

$bkkey = “T02_isbnkey”;
$SLI_bkisbn = $row[$bkkey];

$bktitle = “T02_book_title”;
$SLI_bktitle = $row[$bktitle];

$bkemail = “T02_auth_email”;
$SLI_authemail = $row[$bkemail];

$bkfname = “T02_author_first_name”;
$SLI_authfname = $row[$bkfname];

$bklname = “T02_author_last_name”;
$SLI_authlname = $row[$bklname];

$bksynop = “T02_book_synopsis”;
$SLI_bksynopsis = $row[$bksynop];

$bkregdate = “T02_registered_date”;
$SLI_regdate = $row[$bkregdate];

$bkphoto = “T02_book_photo_link”;
$SLI_photolink = $row[$bkphoto];

$bkebook = “T02_ebook_link”;
$SLI_bkebook = $row[$bkebook];

$bkpbook = “T02_pbook_link”;
$SLI_bkpbook = $row[$bkpbook];

$bkvideo = “T02_video_link”;
$SLI_bkvideo = $row[$bkvideo];

$bkvisit = “T02_page_visits”;
$SLI_bkvisits = $row[$bkvisit];

$bkreview = “T02_book_reviewed_count”;
$SLI_bkreviews = $row[$bkreview];

$bkslipper = “T02_slipper_total”;
$SLI_bkslippers = $row[$bkslipper];

// Bump Book Counter

if ($SLI_Bump_Field == $bkvisit) {$SLI_bkvisits = $SLI_bkvisits + 1;}

if ($SLI_Bump_Field == $bkreview) {$SLI_bkreviews = $SLI_bkreviews + 1;}

// Bump Slipper Total

$SLI_bkslippers = $SLI_bkslippers + 1;

// REPLACE Syntax for book profile record

mysql_query(“REPLACE INTO $usertable
SET
T02_isbnkey=\”$SLI_bkisbn\”,
T02_book_title=\”$SLI_bktitle\”,
T02_auth_email=\”$SLI_authemail\”,
T02_author_first_name=\”$SLI_authfname\”,
T02_author_last_name=\”$SLI_authlname\”,
T02_book_synopsis=\”$SLI_bksynopsis\”,
T02_registered_date=\”$SLI_regdate\”,
T02_book_photo_link=\”$SLI_photolink\”,
T02_ebook_link=\”$SLI_bkebook\”,
T02_pbook_link=\”$SLI_bkpbook\”,
T02_video_link=\”$SLI_bkvideo\”,
T02_page_visits=\”$SLI_bkvisits\”,
T02_book_reviewed_count=\”$SLI_bkreviews\”,
T02_slipper_total=\”$SLI_bkslippers\””)

or die (‘REPLACE did not work ‘.mysql_error());

echo ‘The (‘.$SLI_bktitle.’) record has been created.
‘;

}

}
?>

Loading...