gli Posted April 21, 2008 Share Posted April 21, 2008 Hi! I cant make a code which works. Can you help me please I need code what counts message rows from database table messages where receiver equal to $user and then stores this counted data to users table in pm_count row. thanks. sorry but i tried so much Link to comment https://forums.phpfreaks.com/topic/102154-solved-help-for-count-code/ Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 <?php $query = "SELECT * FROM whatever WHERE user=$user"; $result = mysql_query($query); $count = mysql_num_rows($result); $query = "INSERT INTO users (pm_count) VALUES ($count)"; $result = mysql_query($result); ?> Something like that. Link to comment https://forums.phpfreaks.com/topic/102154-solved-help-for-count-code/#findComment-522876 Share on other sites More sharing options...
gli Posted April 21, 2008 Author Share Posted April 21, 2008 thnx Link to comment https://forums.phpfreaks.com/topic/102154-solved-help-for-count-code/#findComment-522938 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.