-
Posts
1,941 -
Joined
-
Last visited
Never
Everything posted by TheFilmGod
-
Hi. I have no clue what is going on. Here is the code: <?php //already connected to MYSQL mysql_query("UPDATE hits SET counter=counter+1 WHERE page = '$PHP_SELF'",$dbname); if (mysql_affected_rows($dbname) < 1) { $result = mysql_query("INSERT INTO dyphits VALUES ('$PHP_SELF', 1)", $dbname); } $sql = mysql_query("SELECT counter FROM hits WHERE page = '$_SERVER[php_SELF]'"); $hits = mysql_result($sql, 0, 'counter'); echo $hits; mysql_close($dbname); ?> These are the errors I get: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/T/h/e/TheFilmGod/html/test/hits.php on line 20 Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource in /home/content/T/h/e/TheFilmGod/html/test/hits.php on line 22 Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/content/T/h/e/TheFilmGod/html/test/hits.php on line 22 Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 2 in /home/content/T/h/e/TheFilmGod/html/test/hits.php on line 25 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/content/T/h/e/TheFilmGod/html/test/hits.php on line 28
-
How do you retrieve information from mysql? I am already connected to mysql, mysql_query("UPDATE hits SET counter=counter+1 WHERE page = '$PHP_SELF'",$db); if (mysql_affected_rows($db) < 1) { $result = mysql_query("INSERT INTO dyphits VALUES ('$PHP_SELF', 1)", $db); } mysql_close($db); ?> So what would I need to do to retrieve the information that I just updated, "counter" and then echo it?
-
Thanks for all your help so far. I greatly appreciate it. Here's the sql code I used for mysql: CREATE TABLE `view` ( `ID` bigint(20) NOT NULL auto_increment, `count` varchar(6) default NULL, PRIMARY KEY (`ID`), KEY `count` (`count`) ) TYPE=MyISAM AUTO_INCREMENT=1 ; # # Dumping data for table `hitcounter` # I'm not sure if the table is structured properly.
-
No. There was no errors. Nothing happended. It is a blank page with "hello." The test page is at: http://www.TheFilmGod.com/test/vote Maybe my mysql table is completely messed up, I don't know.
-
I tried it and it didn't work. Here is the code I tried: <?php // Page ID $page="1"; require("connect.php"); // Already connected to mysql $query = "SELECT * FROM view WHERE id = $page"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $cnt = $row["count"]; $cnt++; } mysql_query( "UPDATE view SET count = $cnt WHERE id = $page"); // echo the number of hits echo $cnt; echo Hello; ?>
-
Hi, I have been working on a page view counter. Now I haver researched google five times already and can't find a script that calculates a specific page's hits (not the whole site's page htis). So I made my own. Here is the code. I have tried it and it doesn't seem to work. Can you please help me? <?php // Page ID $page="1"; ?> <?php require("db/connect.php"); // Already connected to mysql $query = "SELECT * FROM `table` WHERE id='$page'; $result = mysql_query($query); $cnt = $row["count"]; $cnt++; mysql_query( "UPDATE table SET count = '$cnt' WHERE id= $page";"); // echo the number of htis echo $cnt; ?>
-
Awesome! That's exactly what I wanted to do. My next question is, does anybody know how to + 1 to the count to a cell already selected? I'm new to mysql, any help is greatly appreciated.
-
how do I select a specific row in a mysql table?
-
Okay, I'll explain. The old google used to calculate page ranking by meta keywords. Your serach is the same exact thing. Webmasters put in keywords and depending on the most relevant keyword that search comes up. Its nothing good about that. It means that if you get popular, websites will only compete for the best keywords and optimize to that. As google and all other search engines have proved this, it is a horrible way to search for websites. I know you are trying to make it "webmaster submitted" but you have to understand that if you ever get millions of websites on your site, than only the top keyword optimized sites would be searched and found. So it simply becomes like the old google. I just don't like it. Try making the search something more than keyword based and I then I would like your site.
-
nearly finished site, help with layout ideas
TheFilmGod replied to legohead6's topic in Website Critique
Okay. I at first I sorta liked your website. Thought it was clean and nice. But this time I don't know what happended. I don't see where you are going. I recommend using a blog or a template because the layout isn't getting any better. Maybe if you CHANGE the green color I would like it. - As of now the green makes me go to another website. Just a pointer. -
Hey! I am almost complete with launching my website into the world. It started with bad images, times new roman, horrible color schemes, and lack of professionality. But it has all changed. Go check it out at: URL deleted
-
I tested it, and it works without a problem. I'm not sure if search engines will have issues though. Now I'm trying to get the whole beginning of the html file from "DocType to the end of the head tag under one php inlcude file. We'll see if it works.
-
Is it okay to use php include between the head tags of the html? Will it create any problems?
-
Hi. I need help with some php. I need to change a bit of it. Right now I have a 5 star rating script on my page, but instead of clicking on the stars to vote, users click on radio buttons. I'd like to change this. I'm not the best in php, but I hope you can help me out. echo '<input type="radio" value="5" name="rating_'.$page.'" id="rate5_'.$page.'" />Excellent<br>'; echo '<input type="radio" value="4" name="rating_'.$page.'" id="rate4_'.$page.'" />Very Good<br>'; echo '<input type="radio" value="3" name="rating_'.$page.'" id="rate3_'.$page.'" />Good<br>'; echo '<input type="radio" value="2" name="rating_'.$page.'" id="rate2_'.$page.'" />Fair<br>'; echo '<input type="radio" value="1" name="rating_'.$page.'" id="rate1_'.$page.'" />Poor<br>'; echo '<input type="hidden" name="rs_id" value="'.$page.'" />'; echo '<input type="submit" name="rate'.$page.'" value="Rate" />'; } else { echo '<input type="radio" value="1" name="rating_'.$page.'" id="rate5_'.$page.'" />1'; echo '<input type="radio" value="2" name="rating_'.$page.'" id="rate4_'.$page.'" />2'; echo '<input type="radio" value="3" name="rating_'.$page.'" id="rate3_'.$page.'" />3'; echo '<input type="radio" value="4" name="rating_'.$page.'" id="rate2_'.$page.'" />4'; echo '<input type="radio" value="5" name="rating_'.$page.'" id="rate1_'.$page.'" />5<br>'; echo '<input type="hidden" name="rs_id" value="'.$page.'" />'; echo '<input type="submit" name="rate'.$page.'" value="Rate" />'; } Can you help me by giving any insight on how to change this so visitors can click on the stars to vote, or a picture of a star? I really hate radio buttons. Any help is greatly appreciated.
-
Thanks, but I mean something that is very strict. Evaluates virtually everything. I remember using one that gave me 106 errors, while the one you gave me only finds 6 errors!
-
How do I do rollover images? Please explain in easy english terms. I tried researching on the internet and I'm still confuzed. Any help is greatlly appreciated.
-
Don't use a tag cloud. Instead use a section for the the most popular pages. The most popular page would be on top, just like the most popular page would have the largest font in the tag cloud. Or you can base it on user interactivity. Such as voting. The top voted scripts would be posted on the homepage. I just don't like tag clouds. You are better off deleting the tag cloud, or replacing it with what I have mentioned.
-
How do I make a php counter, to count: a) Total Views of one page b) Unique views of one page c) Use mysql with it I appreciate any help!
-
Google guidelines for high website optimzation: "# You should never have to link to an SEO. Avoid SEOs that talk about the power of "free-for-all" links, link popularity schemes, or submitting your site to thousands of search engines. These are typically useless exercises that don't affect your ranking in the results of the major search engines -- at least, not in a way you would likely consider to be positive." To me that means, "Don't take part of your 'ad' scheme." Its a good idea, but be honest and work hard and you'll be treated with a higher rank by google. Its a tip!
-
A validator says that it is improper to use: </input> . It says that it is invalid. Why?
-
You should make it private and tell your whole family about the site to talk with them. That is what most family websites have, this is because they can talk about private "their own family" things.
-
This is the function I use to determine the font size: function fontSize($voteTotal,$views){ $points = $voteTotal; if($points<1){ $size = 11; }else{ $size = ($points * $views) / 4; } if($size > 40){ $size = 40; } if($size < { $size = 8; } return 'font-size:'.$size.'px'; } Basically all it does is check how many times the page has been viewed, and multiplied it by the total number of votes and then divided it by 4. The rest you probably can understand. Is this a good way of doing it or should I try another way? This is probably the stupidest thing I ever heard of. It is jumbled up text with a maze of different font sizes. Its a good idea but def. something that makes me want to you give a 1.0 out of 10 - F.Y.I
-
This is completely crazy! If you become popular and have people submit there own descriptions of websites to your database, then all that it will return is the top websites with the matching keywords! How is this any better than the old (primate) google and other search engines? You are wasting your time.