I have a small database, at the present time, built for basic tracking and it has 5 rows ...
It's populate with 10 records test data from 3 users (uid)...
I need to return the total visits from each uid... Here's what I have so far and it returns nothing...
<?php $uidTotal = mysql_connect("localhost", "user", "pass"); mysql_select_db("table", $uidTotal); $result = mysql_query("SELECT * FROM tracking WHERE uid = $uid", $uidTotal); $a = mysql_num_rows($result); echo "$a \n"; ?>
Can I run the SQL code inside the body of the page? Does/Can this code go inside the header? Is the code even written correctly? Do I split out the <?php echo $a ?> into the div I need the info from?
Any Help would be great!