Jump to content

EchoFool

Members
  • Posts

    1,074
  • Joined

  • Last visited

Everything posted by EchoFool

  1. Hey guys, How do you in mysql find a the "highest value" in a field ? Im trying to find who has the highest number out of all the numbers in the rows in the field "ticket number". Is there a set function to do that?
  2. I have a format of a number like this: number_format($number,5); to put it to 5 decimal places. Now the problem is say the number is over 1000 it puts a comma: 1,000.12345 which then crashes my query. How can i make it not add a number format with the comma but still keep it 5 decimal places?
  3. Is distinct the best thing to use for this? In your opinion ? Or should i try some other method?
  4. I have never had this error before and no idea what to do to fix it... this is my query: $GetConversation = mysql_query("select distinct(contact1,contact2,contact3) as touch from ((select distinct(messages.receiver) as contact1 from messages where messages.sender = 3 or messages.receiver = 3) as foo, (select distinct(textmessages.receiver) as contact2 from textmessages where textmessages.sender = 3 or textmessages.receiver = 3) as bar, (select distinct(phonecalls.receiver) as contact3 from phonecalls where phonecalls.sender = 3 or phonecalls.receiver = 3) as bat) WHERE phonecalls.receiver='$ID' or phonecalls.sender='$ID' or textmessages.receiver='$ID' or textmessages.sender='$ID' or messages.receiver='$ID' or messages.sender='$ID'") or die(mysql_error()); If you need to know what it's meant to do then ill type it for ya, if its just a syntax thing where have i gone wrong?
  5. No sorry i should have explained better. I am trying to get the ID of the other person that $ID has contacted. For example: ID = 4 So say the table has: The result from my query should show....
  6. Hey guys, I have a query which is causing problems as the "group by" is not working. Not sure how to fix the problem though. This is what i got: $Get = mysql_query("SELECT * FROM msgs WHERE Sender='$ID' OR Receiver='$ID' GROUP BY Sender,Receiver ORDER BY Time") Or die(mysql_error()); What is happening though is im getting two rows the reason why is because of this: In the table theres 2 rows like this: This is why it comes out twice.. how do i merge it so it will only represent that as one not both? Because I am trying to get all users that $ID has spoke to "uniquely" so it should only show one row in the above case because $ID has spoke to ID 2 it doesn't need to tell me twice... hope you can help
  7. I tried this.. works kinda... works when the session exists.. how ever if the session was not created, I get an error saying undefined variable... would it still work with a if isset check prior to echo'in the values?
  8. Is there a way with forms that if a user registers and it doesn't work and the user has to go back, the data will still remain so they don't have to re-fill the whole form again.. what do they use to do this ? Is it standard HTML stuff or php?
  9. so if i wanted it to check for only numbers and letters... it would be: preg_match("/^$/",$text) Also with regards to this: + => Means there must be one or more of the previous character (\w) Does that mean user names "MUST" have an underscore symbol? or have I mis-understood?
  10. So how come this line: if(preg_match("/^\w$/",$text)){ has like a random w in it etc could explain what the symbols all do.. like is it check that the symbols are in the string .. if so do i have to add more symbols to it i want less symbols to be "allowed"?
  11. I need some help i need to find a way in php to check if a string contains only numbers or letters or the symbol _ I know how to check if the string is_numeric but don't how to make it check for symbols other than the _ symbol... What function does this, hope you can help.
  12. well you can do range of id's i think WHERE ID > 0 AND ID < 3 or as you put WHERE ID == 1 OR ID == 2 using less than and greater than. I'd recommend the first method cos then you can alter it to select an easy range of rows using variables in the future. then u while loop and it should only while loop 1 and 2 if they exist in the table
  13. $result = mysql_query("SELECT column1,column2 FROM table"); while($row = mysql_fetch_array($result)) { echo $row['column1']; echo $row['column2']; I think you mean like that? but unless i mis-read your post i aint quite sure i understood you.
  14. Well the reason i mainly asked if a member managed to hack my site i may need to log on to their account... if their password was "V32&3242"$!" encryption then i can't log in to check it out. I would obviously only do such a thing on the most serious of hacking attempts. But then on the other hand i don't want hacker's accessing user's passwords for obvious reasons. So is there a way to de-crypt aswell ?
  15. What is the advantages/disadvantages if any of using : $encrypt_password = md5($Password); From a user and a admin point of view? Also if I insert the encrypted password to the database does that mean in the login I have to do like $input = md5($password); Then check with a query with the encryption code or do you check with the original users input of numbers and letters? Sorry if I sound noobish here .. hope you can help
  16. I have a major problem with using this as a way to test what page a user is on. The problem with it is say i do this: If($_SERVER['PHP_SELF'] == 'test.php') But the user for a joke puts TEST.php then the if statement fails because its case sensitive.. how can i make it only care about the characters rather than the case sensitivity aswell ?
  17. Is it possible in PHP to allow microphones on people's pc's to stream live through the page so any one viewing that page can hear them? And also talk back them... I'm trying to come up with the idea for a chat room but not sure if PHP has this capability. If not what language is best?
  18. I been searching for this function on php's site but all i keep finding is how to upper case a whole sentence... all i want to do is uppercase the very first letter of the string and the rest remain as they are. Does any one know the link to the page of this function ?
×
×
  • 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.