Jump to content

renwoshin

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

renwoshin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. probably should do $query_string = "SELECT username, password FROM accounts WHERE loginname = '$user'"; (need the single quotes around $user)
  2. hey shaunO, Do you mean changing the php.ini configuration? I tried it (by setting smtp_port=4000 in php.ini, restarting apache, and then using the mail function), but it did not work... in fact, i could still send standard email (the phone could still receive my standard SMS). this probably means the email-to-SMS gateway I used (text.att.net) listens on at least ports 25 & 4000 and sends an SMS to the standard SMS app on the phone.
  3. thanks for the response, but my question was more asking how to send to a specific port. I can send an SMS fine to the default SMS application of the phone, but I would like to send it to a specific port (not the default one) so that an application can be triggered upon receipt. i am wondering if it is possible to send to a specific port using the free SMS gateways mentioned in http://en.wikipedia.org/wiki/SMS_gateway like.... mail('1234567890@txt.att.net', ...) except somehow include the port. I tried to send to port 4000 like this => mail('1234567890:4000@txt.att.net', ...) but i don't think that worked because my application did not pop up.
  4. Hello everyone, Does anyone know how to send an SMS using PHP to a specific port? Upon receipt at this port, the phone will trigger a J2ME application. Can we use the standard Email to SMS gateway to achieve this? (ie. AT&T's is 'txt.att.net') or do we need to use Clickatell's API? thanks very much.
  5. specificially, would it be inefficient to add a table for each user? Like, if we had 3000 tables for one database, will that be bad?
  6. hi, i'm trying to make a friend's list type thing for our users, but I'm not sure how I should represent it in a database. Here are the possibilities I thought of: 1) make a table for every username and every row would be a friend 2) make one table for all the usernames and add a column for each friend 3) somehow make a table within a table (is this even possible?) with the inner table being the friends of the username What do you guys think would be the best representation for a "friend's list"?
  7. [!--quoteo(post=334079:date=Jan 6 2006, 10:58 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 6 2006, 10:58 AM) 334079[/snapback][/div][div class=\'quotemain\'][!--quotec--] Wow! I missed a lot of action on this thread. That's what I get for sleeping in.... First, if you're simply making the name of the file the UID, then there's no need to store it -- simply store the path to the image. Second, if you really feel the need to get the next auto_increment value (which you should never, ever need to know), you can always query the table metadata directly: SHOW TABLE STATUS LIKE 'myTableName'; And check the value of the "Auto_increment" (case-sensitive!) field, much like you would parse out an ENUM set. Hope that helps. You, my friend, are a lifesaver.
  8. hi, I have an id column in my table that is auto-incremented. how do i find the next id number? The id is not necessarily the number of rows in the table, because some rows (usually a lot) have been deleted. sorry, wasn't paying attention: [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=82759&hl=\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...topic=82759&hl=[/a]
  9. [!--quoteo(post=330752:date=Dec 27 2005, 12:41 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Dec 27 2005, 12:41 PM) 330752[/snapback][/div][div class=\'quotemain\'][!--quotec--] I guess I have the same question for you as I had for another poster -- what's the basis for keeping the table separate? If it doesn't help, and make thing easier, then you've added unnecessary duplication of fields among tables, and you run into the types of problems you've discovered. oh ok. I just started using mySQL and i have no idea how it searches the table when you query for something. I kept them separate because by using an if statement, I could choose which table to search from. Since mySQL HAS to go through all the elements, if I separated them out, each query would just have to go through 300 rows instead of 3000 rows. Just trading space efficiency for time efficiency, but I'm guessing the time that I save is negligible? And btw, I'm that other poster you're talking about. Thanks.
  10. [!--quoteo(post=330654:date=Dec 27 2005, 07:12 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Dec 27 2005, 07:12 AM) 330654[/snapback][/div][div class=\'quotemain\'][!--quotec--] Not really... if they're in separate tables, you have to run through each one; in principle, you could generate a view in MySQL 5 if you're planning on doing this very often. Furthmore, make sure that your ORDER BY clause applies to the result set _after_ all of the UNIONs -- if you have subselect support, you can easily do this enclosing the entire set of 10 tables + UNION statement in parenthesis, and then issue the order by on the derived table. Otherwise, the parser might get confused. Lastly, if you have do this for many queries, this may be an indication that all these data should reside in a single table with a type flag. Hope that helps. Thanks for the reply man. I guess I will have to design my database differently.
  11. [!--quoteo(post=330652:date=Dec 27 2005, 07:08 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Dec 27 2005, 07:08 AM) 330652[/snapback][/div][div class=\'quotemain\'][!--quotec--] Querying one table is definitely faster than querying 30 tables! By "values" do you mean columns? If so, you probably should be breaking up groups of related fields into different tables to keep with normal-form recommendations for RDBMS table design. Please clarify. Oh, by values i mean by rows. There will only be about 7 columns. Every table will have these same columns. So instead I should have a massive table as opposed to separate ones?
  12. Hi, I was wondering how you could search through all the entries in the tables in the database and have a complete list all in one query. The only way I know how to do is this: $request = "SELECT * FROM cp WHERE email='" . $_SESSION['email']. "' " . "UNION SELECT * FROM dv WHERE email='" . $_SESSION['email']. "' ORDER BY log DESC"; . . . and keep on adding the "union select" for all 10 tables I have. All 10 tables have the same column names. Is there a quicker way to search for one thing through the whole database? Thanks a bunch.
  13. Hi -- I wonder what is more efficient and returns a quicker response for the server: One table with 3000 values, or 30 tables with 100 values each? Thanks
×
×
  • 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.