Jump to content

Solved_

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Solved_'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am planning to outsource a project in 30-50k $ range. Hope you can help me with the following 3 questions: 1. Should I use a framework or not? Like cakephp. What does this mean for performance, scalability? 2. How can I be sure about performance, I want to build a marketplace with some advanced functions (lots of db requests/writing), using all ajax. How to be sure the application will be fast, if used by 5k users at a time? 3. In the development phase is scaling server capacity involved in the php/mysql coding process, or can this be done later, no matter what kind of application is written? Great thanks in advance.
  2. Thanks that worked, am i right, that the only change is $aPost = array(); to above (except the debug ofcourse)? I was empting the array every time..
  3. I have a database table in wordpress, now I want to get all titles, content, order values out of the database and compile to a post and put them in an array. Nothing happens, no errors. If i change some code, I can get the first value, but not a repeated process, to fetch all data. global $wpdb; $sDB = $wpdb->get_results("SELECT my_title, my_content, my_order FROM my_table"); foreach ($sDB as $sDBOutput) { $sATitle = $sDBOutput->my_title; $sAContent = $sDBOutput->my_content; $sAOrder = $sDBOutput->my_order; $sCompiled = '<div class="title">' . $sATitle . '</div><div class="content">' . $sAContent . '</div>'; $aPost = array(); $aPost[$sAOrder] = $sCompiled; }
  4. thanks! brilliantly simple, just started with php, so I can add things to the array afterwards.
  5. I get a random number of database results (based on some criteria). Now I want to add two more pieces to the array, that are always the same, Key = 3 Value is "part 1" and key = 5 value = "part2", I use $number from database as KEY, that are always even numbers. Now I want to create a array that mix the pieces from the database with the two static parts. I am a bit of a beginner, how can I add two parts, without adding them multiples everytime the loop runs? $result = mysql_query('SELECT * FROM table') or exit(mysql_error()); $number = mysql_query('SELECT * FROM table') or exit(mysql_error()); while ($row = mysql_fetch_assoc($result)) {$array[$number] = $row;} print_r($array);
  6. Thanks! got it, yeah, have to try more myself if (isset($aTranslate[$value])) { $alt = $aTranslate[$value];
  7. Hi ignace, thanks for your help, I have tested your code, but it doesn't work the right way. It translates the keys of the first array, i.e: array(1, 2, 4, 5, 7, 12, 15); into the words list 1 => 'bread', 2 => 'piza', 3 => 'water', 4 => 'cornflakes', 5 => 'word5', 6 => 'word6', 7 => 'word7', 8 => 'word8', 9 => 'word9', So the first one is empty, because the key is 0, and then it translates the keys from bread until word6, not the real translation. Any solution?
  8. I have build this array, but I have really no clue how to finish the coding. $aTranslate = array( 1 => 'bread', 2 => 'piza', 3 => 'water', 4 => 'cornflakes', 5 => 'word5', 6 => 'word6', 7 => 'word7', 8 => 'word8', 9 => 'word9', ); What does: foreach($aWords as $key => $value) the relation $aWords as $key => $value mean? If I echo $aTranslate in the foreach I get "array" repeated every time. If I change $key to $aTranslate: foreach($aWords as $aTranslate => $value) Then it counts from 0 to 5 if I use 6 values in $aWords = array(1, 2, 5, 7, 8, 9);
  9. One more question: Showing images is easy because I can base the matching on the numbers it self. What if I want to show the word bread for 1, and pizza for 2, ect..?
  10. Thanks. I have this code now, which is working. <?php $aWords = array(1, 2, 4, 5, 7, 12, 15); foreach($aWords as $key => $value) { echo '<img src=('.'http://example.com/imagepath/'.$value.'.jpg'.')/>'.'</br>'; } ?>
  11. Beginner here: I have a array with numbers out of a database, and they correspond with words. This is the translation I already know: 1 = bread 2 = pizza 3 = water ect... Lets's say the array contains the following numbers: $aWords = array (1, 2, 4, 5, 7, 12, 15); Now I want to check if a number is in the array, and then echo a image if it is there, so a bread image for 1, and a pizza image for 2. I used a switch, but this stopped after finding the first case. I can use a lot of if statements but is there not a easier function I can use?
×
×
  • 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.