Hello all,

I'm a graphic designer making a site for giving tutorials, but since i'm just a newbie 
in coding, tons of problems have fallen on me.

This is my photoshop_tutorial table structure

id int not null auto_increment,
title varchar(255) not null,
author varchar(55) not null,
description text not null,
date int(14) not null,
tutorial mediumtext not null,
view int not null,
primary key (id),
unique id (id)

In the show_photoshop_tutorial.php, i used this

// Fetch info of the tutorial

$result = mysql_query("select * from photoshop_tutorial where id=$id");
while($row = mysql_fetch_array($result)) {

// Format the date


// Add 1 view to the view column

$v = $row[view];
$vplus = $v+1;
$view = mysql_query("update photoshop_tutorial where id=$id set view=$vplus"); // 
Problem here!

// Fetch user's info from another table

$user = mysql_query("select * from site_users where displayname = '$row[author]'");
$get_info = mysql_fetch_array($user);

// Print out query results to the screen

echo "<p><b>$row[title]</b><br>";
echo "Author: <b><a href=\"mailto: 
".$get_info[email]."\">$get_info[displayname]</a></b> on <b>$postdate</b> view ";
echo "<p>$row[description]";
echo "<p>$row[tutorial]";

But the view doedn't add 1 to the existing value

Any solutions for that?

Best regards,

Le Hoang

Reply via email to