Jump to content

ok

Members
  • Posts

    130
  • Joined

  • Last visited

    Never

Everything posted by ok

  1. I want to count the index of an array. can you give me advice, what is the name of a built in array function, that will count its index. thank you.
  2. Hi guys i have these fields below, id | invited_by | tota l --------------------------- 1 | anna_anna | 2 2 | iridion_iridion | 2 3 | solid_solid | 0 4 | anna_anna | 2 5 | iridion_iridion | 3 6 | solid_solid | 0 I want to get the maximum value of the column 'total' which is 3 and under the name of iridion_iridion I have these codes below, $query = "SELECT invited_by, MAX(total) AS total FROM winner_tmp GROUP BY invited_by"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $row = mysql_fetch_array($result); But it did not show the right result that i need. Can you show me the right SELECT for this please. Thank you.
  3. oh i think i get now the problem. problem solved.
  4. I have these codes below that will read unique user_name only from a table but the problem is it duplicate the last name. for example like this one, anna anna iridion iridion solid solid solid sollid and here is the codes. <?php include 'opendb.php'; $query = "SELECT user_name FROM user_join GROUP BY user_name"; $result = mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); $i=0; while($row = mysql_fetch_array($result)) { $row2[$i] = $row['user_name']; echo "<br>". $row2[$i]; $i++; } ?> thank you.
  5. Hi guys, very basic problem with foreach.. below is the codes. $multi_winner[$i] = $row['invited_by']; foreach ($multi_winner as $value2) { echo "<br>multipler_winner: ". $value2; } below is the error message. Warning: Invalid argument supplied for foreach() Thank you!
  6. i have a column for instance this below, price ----- 6 5 20 30 22 4 53 11 now from those row i want to get the highest value. can you show me an exmaple myslq syntax for that please. Thank you.
  7. hi guys let say i have a field and this field has many records. but some record have duplicates. now how can i select the uniqe record name only in the field? for example, user_name ----------- john john joey joe gina karen warren karen george warren i want to select them all but not including the duplicate so if i want to select the the name only not including the dupliate then the result is user_name ----------- john joey joe gina karen warren george can you show me the right mysql select command please. Thank you.
  8. hi guys can you give me advice on how do you organize, housekeeping, track variables value? Thank you very much in advance.
  9. what's wrong with these codes? $query = "INSERT INTO user_join (user_name, email, invited_by, date_join) VALUES ('$ufull_name', '$uemail', '$rfull_name', 'now()'"; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); Thank you?
  10. is there a way to send the email into inbox only? can you show me some sample codes please. thank you in advance.
  11. @pocobueno1388 Thank you very much!
  12. Hi guys i'm trying to attached a variable value into an url. I have 2 files, the first file will send an email with a link and with variable value and the 2nd file will catch the variable value. When i open the email and press the link it did show the url with the right variable value as an url, but the 2nd page that should catch those variables didn't display the variable value, meaning it's not working. here is the codes that attach the variable value. $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br> Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br> <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufname={$ufname} \"><h4>Please Click here to join!</h4></a> {$_POST['ufull_name']} Join now and be a candidate to win the $50 dollar gas card every week.<br> For more details please visit the link.<br><br> <h4>Thank you!</h4> </body> </html>"; This is the full codes, that will email and attach the variable value. <?php echo "ufull_name: ". $ufull_name; $_POST['ufull_name'] = $ufull_name; $recepient = $femail; $subject = "Tell a Friend Contest!"; $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br> Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br> <a href=\"http://www.lexingtonssuddenvalues.com/contest.php?ufname={$ufname} \"><h4>Please Click here to join!</h4></a> {$_POST['ufull_name']} Join now and be a candidate to win the $50 dollar gas card every week.<br> For more details please visit the link.<br><br> <h4>Thank you!</h4> </body> </html>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: lexingtonssuddenvalues.com <donotreply@lexingtonssuddenvalues.com>' . "\r\n"; $headers .= 'Cc: donotreply@lexingtonssuddenvalues.com' . "\r\n"; $headers .= 'Bcc: donotreply@lexingtonssuddenvalues.com' . "\r\n"; // multiple recipients $to = $femail; mail($to, $subject, $message, $headers); ?> by the way this is the 2nd page that suppose to catch the variable value. <?php $ufull_name = $_POST['ufull_name']; echo "ufull_name: ". $ufull_name; echo "<br>ureferer: ". $ureferer; echo "<br>ufname: ". $ufname; echo "<br>ulname: ". $ulname; ?> Thank you!
  13. hi guys i have these message content of an email using mail() below, $message = " <html> <head> </head> <body> <h3>Dear $ffname,</h3><br> Your friend $ufname $ulname is inviting you to join a $50 dollar gas card.<br> ?> <a href=\"<?php echo $tmp_dir; ?>ureferer=$ufull_name \"><h4><h4>Please Click here to join!</h4></a> <?php Join now and be a candidate to win the $50 dollar gas card every week.<br> For more details please visit the link.<br><br> <h4>Thank you!</h4> </body> </html>"; actually i'm trying to insert a link inside the message of an email which is html format and that will carry a variable value. but it's not working. can you show me the right way please thanks.
  14. Hi guys i want to assign a foreign key. I have two tables below, CREATE TABLE `joealex3_contest`.`user_join` ( `id` INT NOT NULL AUTO_INCREMENT , `user_name` VARCHAR( 100 ) NOT NULL , `email` VARCHAR( 100 ) NOT NULL , `date_join` DATETIME NOT NULL , PRIMARY KEY ( `id` ) , INDEX ( `user_name` , `email` , `date_join` ) ) ENGINE = MYISAM CREATE TABLE `joealex3_contest`.`invitation` ( `id` INT NOT NULL AUTO_INCREMENT , `user_name` VARCHAR( 100 ) NOT NULL , `invited` VARCHAR( 100 ) NOT NULL , PRIMARY KEY ( `id` ) , INDEX ( `user_name` , `invited` ) ) ENGINE = MYISAM Noticed that the user_name field column exist on both table. I want the user_name column field in the invitation table to have a foreign key.can you show me the exact changes or table structure for this. And another question is it really necessary to make the column field user_name that has the foreign key to have primary key? if yes why? Thank you.
  15. Ok here is the scenario. This is tell a friend contest. People can sign in and just tell their friend as many as they about a particular promo. So for example if Joe tell his friend, anna and josephine. He will have this record below. joe --------- anna josephine Then anna also invite his friend joey, jack, george and karen. now anna have this table below, anna --------- joey jack george karen and vice versa. but anna can't invite joe, since joe invited her already. anyway what is the best Relational Database for this? Thank you!
  16. i'm trying to insert date & time. i tried this below $query = "INSERT INTO contest (date, time) VALUES ('.curdate().', '.curtime().')"; but i fail. what is the correct syntax? thank you.
  17. ok

    date field?

    i have a 'date' field name in mysql. my question is, is this name will conflict? or not? Thank you.
  18. i'm designing a basic search when i type this 'carbon' for example. it should display related words. CarbonAutdit.com Carbonneering.com Carbonfactory.net CArbonbuyers.cn etc... what function or could you show me exampe that fits for this please. thank you.
  19. I'm wondering if there is a limit for the array? How many characters or bytes it can handle? Thank you.
  20. I have this string below. http://GreenCareers.com now i want to split it i want to remove this --> http:// and just retain this --> GreenCareers.com show me please. thanks in advance.
  21. ok let say i have 10 records and it has auto increment id. now i want to select only the odd numbers of the id? example: id: 1, 3, 5, 7, 9 how can i do this using SELECT? thank you in advance.
  22. ok thanks man for the reply. yeah i just want to save it as .csv, how could i do that? and can you show some php example parser codes please. Thank you again.
  23. hi guys i want to pull data from excel, could you tell me what is the easiest way to pull data from this excel file using php? or could you show me some sample php codes please. Thank you in advance.
  24. please exclude php.net manual. thank you.
×
×
  • 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.