Jump to content

playwright

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

playwright's Achievements

Member

Member (2/5)

0

Reputation

  1. I have multiple datetimes. The format is dd-mm-yy, hh:mm. I want to insert it into a table using mysql. However mysql format is yy-mm-dd, hh:mm:ss. How can i do it and what type should i use (datetime?timestamp?). Thanks for your help!!
  2. I have a table (id,name,number). Id is auto-increment so it is different in every row. I want to add more entries in my table. However, when i add entries i don't want to insert rows that name AND number that are identical to another row that already exists. For example if there is already a row in my table (4,'Bill', '345'), I want to be able to insert (NULL,'Bill','667') or (NULL,'John','345') but not (NULL,'Bill', '345') (i use NULL since it is auto-increment) Is it appropriate to use unique (name,number)?
  3. You mean that i should remove primary key index from the id field?? i understand what you say about unique indexes. However,i want to be able to enter rows like this one: (id, 'John','567') if there is already an entry like : (id, 'John', '123') or (id,'Bill','567') So i cant use unique index. Actually i shouldn't have entries that have identical name and number with another row. However, the entire row won't be identical since id is different.
  4. Hello.I have created a table with some rows. Then, i want to add more rows in the table using insert into. However, i need to check if any of the rows that i add is ALMOST identical to a row that already exists, so as to avoid adding rows with the same content in the same table. To be more specific i have a table like this one: First column: id (primary key), Second column:name, Third column:number (1,'John','123') (2,'John','123') (3,'Bill','345') I dont want to enter both first and second entry since they have the same name and number. Should i first enter them and then delete the one? Any ideas???
  5. Actually i am grabbing datetimes from a text and i want to put them in a db. The format of these datetimes is dd-mm-yy hh:mm. When i put them in the db it shows 0000-00-00 00:00:00 and this happens with all datetimes. I use mysql and datetime type in my table. I think i should do some convertions. Any ideas?
  6. Hello!! i want to save datetimes into a mysql database. Their format is dd-mm-yy hh:mm. I think mysql format for datetime is yy-mm-dd hh:mm..How can i convert them??
  7. Is there a way to fill one column of a table and afterwards fill the rest columns??For example i have a table : abc('id','a','b','c') and i want to fill first the column 'id' and 'c' (where id is the primary key) with elements and then fill the other columns.. As a result i want to have all rows filled with all elements but is this possible to do it in 2 steps???
  8. You 're right..I used the pattern you said and it works fine now!!
  9. Hello!! i want to grab all content that is between the tags <-- message --> and <!-- message -->.. I have found the right pattern to do so which is something like preg_match_all('%<!-- message -->(.+)<!-- / message -->%si',$x,$y) but it seems that it grabs all content from the 1st tag <-- message --> untill the last tag <!-- message --> in one record. However, there are many more such tags between the first and the last encounter and the thing is that i want to fill my array with all this records separately..Any ideas???
  10. Problem solved..I just needed to use foreach ($y[$i] as $img){}..
  11. I'll be more specific : i Want to grab every : <img src="blablabla" border="X" alt="" title="X" class="X" /> that exists in the source code..That's why i use preg_match_all(). Then i want to check for every record if in "blablabla" a specific word is contained.Let's say if "smilies" is contained in "blablabla". And "smileys" appears only in 30th position of "blablabla" and that's why i use substr()..
  12. it gives me an error Invalid argument supplied for foreach()..
  13. I want to create a table $y that contains anything that matches with the pattern /<img src\=[\"](.*?)[\"] (.*?)>/si'..Then convert any value of the table into string so as to check if the value contains a specific phrase..That's way i'm using substr().
  14. hello!! is there any function that can convert every single value of an array into string??? I tried implode() but i think it converts the whole array into one string..maybe i'm wrong..this is what i'm trying to do.. preg_match_all('/<img src\=[\"](.*?)[\"] (.*?)>/si',$x, $y); $count = count($y; for ($i=1;$i<=$count;$i++){ $keys = implode("+",$y[$i]); $new = substr($keys,30,7); } any ideas??
×
×
  • 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.