pocobueno1388
Members-
Posts
3,369 -
Joined
-
Last visited
Never
Everything posted by pocobueno1388
-
Put this at the top of your script: error_reporting(E_ALL);
-
Change this line: if (mysql_result($result, 0, 0)>0){ To: if (mysql_num_rows($result) > 0){
-
You would have to use JavaScript to do this, not PHP.
-
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.
-
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".
-
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.
-
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
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. -
[SOLVED] Need help putting together query.
pocobueno1388 replied to pocobueno1388's topic in MySQL Help
Illusion - I get an error saying "Invalid use of group function". Teng - Yours doesn't work either. -
[SOLVED] PHP/SQL Limit 5-10? How can I do it?
pocobueno1388 replied to Guardian-Mage's topic in PHP Coding Help
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"; -
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.
-
You would get much more help in the javascript forum.
-
Why don't you just switch servers?
-
Don't forget to press "solved"
-
[SOLVED] Logout is not re-directing to index.php file.
pocobueno1388 replied to sayedsohail's topic in PHP Coding Help
<?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. -
Post your array, then your function.
-
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.
-
Take a look at this tutorial: http://www.tizag.com/sqlTutorial/sqljoin.php
-
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?
-
Yes, there is.
-
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.
-
You should look into cURL, I think thats what your looking for.
-
[SOLVED] Space in ['This Name'] stops it working
pocobueno1388 replied to theredking's topic in PHP Coding Help
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". -
Came from this page: http://php.net/function.gethostbyaddr