Jump to content

JackCode

Members
  • Posts

    26
  • Joined

  • Last visited

JackCode's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, basically I want a dynamic hit counter every time someone views someone else's profile. Here is my code: <?php $req = mysql_query('select hits from users where username="'.$username.'"'); $dn = mysql_fetch_array($req); $update = mysql_query('UPDATE users SET hits = hits + 1 WHERE username="'.$username.'"'); echo "Profile views: ".$dn['hits']; ?> It returns the value in the database but does not update it dynamically unless I change it myself in the database.
  2. The code is a few hundred lines, and I don't think there is any problems with it, I just thought maybe there would be some javascript I could use or something?
  3. So I have a simple forums that allows you to speak to different members but they're a lot of problems with it. So first off when you reply you can't include a new line. Another problem is symbols, there change to weird black symbols. Also if you post text with no spaces then the text will expand out of its div. My forums is: Ransack.comze.com/circle.php example of random symbols: http://ransack.comze.com/topic.php?id=20 example of text going out of div: http://ransack.comze.com/topic.php?id=15
  4. echo "<td class='left'><a href='member.php?id=<?php echo $dnn['id']; ?>'>$username<?php echo htmlentities($dnn['username'], ENT_QUOTES, 'UTF-8'); ?></a></td>";
  5. *Freinds *Circle Happy now? Why so picky about such little things, its not a formal forum is it? I just asked for some simple help...
  6. Thanks, that was a little more helpful. Here's my answer to your questions: 1. I was given these database info by my PHPmyadmin host. 2. Same as above. 3. OK, thanks but I thought by default it chooses the top row which for me is default, so I don't need to have a criteria. 4. OK, thank you, but I got this from: http://php.about.com/od/phpwithmysql/ss/mysql_php_2.htm 5. OK, then could you tell me an alternative? Thanks, I am in the process of learning. Spell? I can spell perfectly fine thanks, at least I know how to use grammar properly as-well. Anyway, I'm not trying to gain a better impression, I'm trying to learn how to programme in PHP.
  7. First: Why is it obvious? I'm learning, don't you have to start from somewhere? Second: I have been reading a book, 'PHP and MYSQL for dynamic websites' by Larry Ulman. Thirdly: I was only asking for a little bit of help, now please could you spare a minute to give some instead of telling me how useless I am?
  8. Sorry I don't know PHP very well, just started it and I'm 13. I call the $info variable inside the first link.
  9. Whats wrong with this? Basically I'm trying to create a universal link for people logged into go to their profile named profile.php. I want the code to grab their id and then take them to their specific profile page like <a href="profile.php?id=idhere">My profiel</a>. So here is the code I have but it doesnt work: <?php mysql_connect('localhost', '732936', 'jackfinley3000') or die ($error); mysql_select_db('732936') or die ('$error'); $query = "SELECT * FROM `732963`'" or die('mysql_error()'); $info = mysql_fetch_array($query); ?> <div id="secmenu"> <ul id="nav"> <li><a href="profile.php?id=<?php echo $info; ?>">My profile</a></li> <li><a href="#">Packs</a></li> <li><a href="#">Freinds</a></li> <li><a href="#">Cirlce</a></li> <li><a href="#">Private Messages</a></li> </ul> </div> </div>
  10. I put it under my link and when I log in it says: array [username] => Jack [id] => 2
  11. Ch0cu3r I have sent you a message with my code. Please reply?
  12. Using a web server: my website is backupransack.freeoda.com If you look on the home page then game page the home page is missing the 'my profile' link.
  13. No I don't mean that I mean there is no errors with the HTML because I tried the PHP in a page with no other code and when I tested it there still was no link so there must be an error with the PHP code causing it to not appear.
×
×
  • 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.