Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. post your database (tables) structure
  2. you want to select unit_type too in this query
  3. yes use GRUP BY unit_id in your SQL
  4. $banners = array(); while (list($link, $banner1) = mysql_fetch_row($banners)) { $banners[]='http://www.mysite.com/click.php?id='.$link.',/images/banners/'.$banner1; }
  5. [/code]... er/or/images/cars/'.rawurlencode($row['cphoto']).'" style="width: ...[/code]
  6. try while ( $row = mysql_fetch_array( $request ) ) { $index = str_replace("movie-link", "", $row[2]); $array[$index][] = $row[3]; }
  7. try <?php $test = '<td align="right">Sale Date :</td> <td align="LEFT" colspan="2"> 1/02/09 01.28.1999 10*9.9/99=1 </td>'; $pat = '/[0\s]([1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])\2((19|20)?[0-9][0-9])/'; preg_match_all($pat,$test,$out); $out = $out[0]; foreach ($out as $k => $v) $out[$k] = trim($v); print_r($out); ?>
  8. change <?=$show?> to <?=$page_name?>
  9. use this scenario 1. insert row in table with some date 2. get last insert id 3. move file 4. update row in table (use id from step 2) or delete row if get error on step 3
  10. try $vpage='$vtest = fAVINPicture(\'pics/\', \'bild2.jpg\', \'This is a picure of a giraff\', \'\', \'\', $WapVersion);'; eval($vpage); echo $vtest;
  11. <?php function get_member_emails($type){ $inc = 0; //inicijal variable dbconnect(); $sql = "select email from member where type = '".$type."' AND email != ''"; $result = mysql_query($sql); echo $num_rows = mysql_num_rows($result); while(($row = mysql_fetch_row($result)) !== false) { $inc = $inc + 1; // add one $ if($inc == $num_rows) // change = to == { echo $row[0]; //if last result print this } else { echo $row[0].", "; //else print this } } return $select; } ?>
  12. change line $order = array('\r\n' , '\n', '\r'); to $order = array("\r\n" , "\n", "\r"); or use nl2br() function
  13. you can't srart session after any output
  14. look http://www.server2go-web.de/
  15. try insert into `test` select '', temporyTest.* from `temporyTest`
  16. or you can use <?php $rank = array(3,7,7,7,7,3,7,3,7,7,7,3); print_r(array_count_values($rank)); ?>
  17. change your js code and close form tag <html> <head> <title>Dynamic Form test pge</title> <script language="javascript"> var i = 0; function changeIt() { i = i+1; my_div.innerHTML = my_div.innerHTML+"<br><input type='text' name='mytext"+i+"'><br/>" } </script> </head> <body> <form action="test-js-php.php" method="post"> <input type="button" value="test" onClick="changeIt()"> <input type="submit" value="submit"> <div id="my_div"> </div> </form> </body>
  18. try //form part <?php $stuff = mysql_query("SELECT * FROM `database`.`table` WHERE ShowID=$info") or die(mysql_error()); while ($in = mysql_fetch_assoc($stuff)) { echo "<TR><TD><input type=\"text\" size=\"60\" name=\"class[".$in['ID']."]\" value=\"".$in['Class']."\"></td></tr><TR><TD>"; echo "<textarea input type=\"text\" name=\"results[".$in['ID']."]\" rows=10 cols=60></textarea></td></tr>"; } echo "<TR><TD>"; ?> //update part <?php foreach ($results as $classID => $line) { $insertLine = explode("\n", $line); for ($i = 0; $i < 14; $i++) $insertLine[$i] = mysql_real_escape_string(trim(htmlentities(stripslashes($insertLine[$i])))); $query = "UPDATE `database`.`table` SET `Champion`='{$insertLine[0]}', `Reserve Champion`='{$insertLine[1]}', `1st`='{$insertLine[2]}', `2nd`='{$insertLine[3]}', `3rd`='{$insertLine[4]}', `4th`='{$insertLine[5]}', `5th`='{$insertLine[6]}', `6th`='{$insertLine[7]}', `7th`='{$insertLine[8]}', `8th`='{$insertLine[9]}', `9th`='{$insertLine[10]}', `10th`='{$insertLine[11]}' WHERE `ID` = '{$classID}'"; mysql_query($query) or die ("Error in query: $query"); } ?>
  19. can you explain TERRIBLY (more then 0.01 sec?)
  20. you can use mysql_affected_rows() 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.