Jump to content

pocobueno1388

Members
  • Posts

    3,369
  • Joined

  • Last visited

    Never

Everything posted by pocobueno1388

  1. Put this at the top of your script: error_reporting(E_ALL);
  2. Change this line: $result=mysql_query($query); To: $result=mysql_query($query)or die(mysql_error()); That will tell you what the problem is.
  3. Change this line: if (mysql_result($result, 0, 0)>0){ To: if (mysql_num_rows($result) > 0){
  4. Show us your code. There is most likely a problem with your query.
  5. You would have to use JavaScript to do this, not PHP.
  6. Look at your first query: INSERT INTO test You are wanting to insert into the "test" table. It's telling you that you can't because that table doesn't exist.
  7. Your database is called test, and so is your table...therefor it is defined as test.test. So it is saying there is no such table named "test" in the database "test".
  8. Change this line: mysql_query($query) or die('Error, insert query failed First One'); To: mysql_query($query) or die('Error, insert query failed First One <br>ERROR: '.mysql_error()); Tell us what it prints out.
  9. Yeah, I was thinking that, but wouldn't that add all the rows together? I just need to count how many rows for each user voted for, so I don't understand how I would use SUM() in the query. I will keep playing with it to see if I can get it to work.
  10. Illusion - I get an error saying "Invalid use of group function". Teng - Yours doesn't work either.
  11. Try this: $query1 = "SELECT news_id,news_name,news_created,news_poster,news_comments,news_read,news_content FROM portal_news ORDER BY ABS(news_id) DESC LIMIT " . PORTAL_DISPLAY_NEWS_MAX.", 10";
  12. Okay, I am stumped on how to form my query to get my desired results. I have a table like so: TABLE 'club_votes' ------------------ vote_for [A players unique ID] clubID [A clubs unique ID] Here is some example data of what the rows would hold: Vote_for ClubID -------- -------- 1 1 10 1 1 1 1 1 10 2 5 2 6 2 6 2 1 2 Look at the "vote_for" column, "1" got 4 votes for club 1 since the number appears 4 times. What I am trying to do is display the person who got the most votes for each club. So according to the rows in the table, I would want to output this: Club Winner ----- ------- 1 1 2 6 Any help putting this query together would be greatly appreciated =] Thanks.
  13. You would get much more help in the javascript forum.
  14. Why don't you just switch servers?
  15. <?php session_destroy(); echo "<center>Successfully, Logged out<strong>" .$row['NAME']. "</strong><BR> <BR><a href='index.php'>Click here if your browser is not redirecting automatically or you don't want to wait.</a><BR></center>"; print '<script type="text/javascript">'; print "window.location='htdocs/index.php'"; print "</script>"; ?> Give that a try.
  16. Do something like this: <?php $images = array("1.jpg", "2.jpg", "3.gif"); shuffle($images); echo "<img src='".$images[0]."'>"; ?> I was beat to it...but here is mine anyways.
  17. Take a look at this tutorial: http://www.tizag.com/sqlTutorial/sqljoin.php
  18. Well, you are going to need a unique key in each table that relate to eachother first. Could you give more information on both tables?
  19. Just use a while loop. <?php $GetLetters = mysql_query("SELECT * FROM messages WHERE reciever = '{$_SESSION['Current_User']}'"); while ($row = mysql_fetch_assoc($GetLetters)){ echo $row['sender'].'<br>'; echo $row['subject'].'<p>'; } ?> That will loop through all the rows that match the query.
  20. You should look into cURL, I think thats what your looking for.
  21. I'm not completely sure on where you can and can't use spaces, but I'm sure they aren't allowed in many places. Even if you can put a space there, it wouldn't be the common practice of doing things. Usually you just use an underscore to represent a space (_). So instead of "First Name" do "first_name".
  22. Came from this page: http://php.net/function.gethostbyaddr
×
×
  • 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.