premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Maybe his boyfriend?
-
And how many people died from overdosing on Marijuana? 0. GD States need to leaglize it!
-
Can you post the current query you are attempting to use?
-
If I remember correctly the vi exit/save is something like :wq! Just remember to be "esc" out of text editing before attempting to run that command. EDIT: Given that vim is the same as vi (sorry I haven't used SSH in ages).
-
I think it works in that it sort of creates a "view" on the fly which is a temporary table. And since that does not actually limit the results it works. The gist, it is creating it's own table with the results, and since it is creating a temp table of sorts the limit feature has been implemented for that and it is not really a "subquery" all though it is. That is the best explanation I have, someone may have more technical terms for it etc and can explain it better, but yea. That is how it works in my head. Either way, glad it worked! I am pretty good at finding work arounds for certain stuff, it is nice that there was a work around for it EDIT: Remember to click solved (bottom left hand corner) if the subject is solved to your liking.
-
I've been researching and seen a few "hack" attempts at this, so here is my shot: SELECT `id` FROM `soundoff_hof` WHERE `id` NOT IN ( SELECT `id` FROM (SELECT `id` FROM `soundoff_hof` ORDER BY `score` DESC LIMIT 15) as tempTable) See if that works, I think it should but yea It is a pretty nasty looking hack.
-
http://dev.mysql.com/doc/refman/5.0/en/subquery-errors.html Looks like LIMIT is not allowed in SubQueries. Not sure what you can do here to fix it, moving to MySQL section as they may be able to provide more insight. EDIT: When you run that full query, not just the parts, in the console what is the error message you are given?
-
What version is your MySQL? The subquery will only work on MySQL 4.x +. I bet you are using MySQL 3.x and that would be why...what is the exact error you are getting if you are using MySQL 4.x + ?
-
Umm this query contradicts itself...usually you want some type of WHERE in the subquery to pull the data you do not want to delete. But basically you are saying DELETE all from that table where the id is not IN (ALL RECORDS), so nothing will ever be deleted. Your logic is skewed, and as Zanus said, it is better to test queries in a console first before putting them in your script. EDIT: Sorry it is the end of the day, just noticed the LIMIT Please disregard that.
-
Change ereg to preg as that is the preferred method. Or just turn off the errors, in my opinion, I would fix those to work with the preg methods.
-
Well the calltype is definitely causing the issue. Technically the query is distinct, since one call type is I the other is O. There is no way around this, as far as I know other than leaving that field off. You may be able to do some fancy sub-querying (such as displaying total 16 - 11 I - 5 O in one line but I do not think it would be worth it, in my opinion.)
-
If you have SSH access use the vi editor (given that its a *nix based sever).
-
Combine the forms into one? Other than that, I do not think there is.
-
You are either using Google Suggestions, which is common on the google toolbar. Or your browser has a "remember what I type in fields" and it is turned on.
-
If you are pulling data from a database, you can use rand() in the order by. SELECT message FROM messages ORDER BY rand() LIMIT 5 That will pull 5 random messages from the database.
-
FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it As for the OP, not sure if this is what you were after: $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} AND i.itmtype={$2} ORDER BY i.itmtype ASC"); I think that is what you were after. Just needed an AND statement. EDIT: You may have to change the variable $2 to be the actual variable, as $2 is an invalid variable name in PHP.
-
Well the broken parts, could have been from you opening it. As without the proper tools the discs can easily be broken. If the parts did break on their own, chances are it was a harddrive issue and you should have returned it (if it was still under warranty) for a replacement. But since opening the case you voided that. So yea, best bet is either someone dropped it when you were not looking, you just got a lemon harddrive or the Underpant Gnomes decided that you had some underpants hidden on your harddrive and wanted to try and get it out, but failed. I highly doubt it unless the software some how messed with the power being sent to the harddrive and caused it to spin sooo fast that the disks broke. But I have never heard of or seen that happen.
-
Why do two queries? One will suffice. $query = mysql_query("SELECT username, password, level FROM users WHERE username='$username' LIMIT 1") or trigger_error("Query Failed: " . mysql_error()); $numrows = mysql_num_rows($query); if ($numrows > 0) { $row = mysql_fetch_assoc($query); if ($username == $row['username'] && md5($password) == $row['password']) { if ($row['level'] == 9) { $_SESSION['admin'] = $row['username']; // use $row cause the original $username should be escaped and may cause issues. } $_SESSION['user'] = $row['username']; header("Location: member.php"); } } } A bit cleaner and easier to read without redundancies. EDIT: Fixed the = on the username/password checked, it was one = should have been two. Also, you should really do mysql_real_escape_string on the part where you assign $username to a variable that is going to be inputted into the DB.
-
Do you even have a database setup? If so which one, MySQL ? This is a rough example that you will need to cater to your database: <?php $conn = mysql_connect("localhost", "username", "password") or trigger_error("Could not connect: " . mysql_error()); mysql_select_db("yourdatabasename") or trigger_error("Unable to select DB: " . mysql_error()); if (isset($_GET['user'])) { $user = mysql_real_escape_string($_GET['user']); // mysql_real_escape_string will prevent against sql injection $query = mysql_query("SELECT BusinessName FROM table_name WHERE userID = '$user'") or trigger_error("Query Failed: " . mysql_error()); while ($row = mysql_fetch_assoc($query)) { echo $row['BusniessName'] . "<br />"; } }else { echo "No user supplied."; } ?> If any of that is confusing I would go find a tutorial on PHP / MySQL.
-
When you say field, do you mean an HTML form field? Has $BusinessName been defined else where? If you have more code please show us so we can better help you as well, just remember to place code inside of tags.
-
And it leaves shit all over the screen.
-
lol Worgens would be badass, gobos just suck. As for horde, they do have the BE The BE Pally is probably one of the most OP class/race in the game. But yea, it would be interesting to fly in Azeroth. I may get a 10-day trial just to try that out when Cat comes out, but I do not see how they are going to get me to want to subscribe again, but we shall see.
-
Not sure if this is what you are after: <a href="http://www.lyroy.com/flyer1.html" target="_blank"> That will open it in a new window.
-
Looking at the PS Man came across this: So if you know the id, perhaps that will give you all the threads related to it. This is given that I understood what you were after correctly.