Welcome Guest, Not a member yet? Register   Sign In
Calling a database to make an array string
#2

[eluser]PhilTem[/eluser]
You're using the foreach loop in the wrong way: the loop needs to be outside of your data processing not inside.

I tried fixing your code but I'm not able to, because I don't know where the initial tag_input comes from. Would however be something like this

Code:
foreach ( $query->result() as $row )
{
  $tag_input = str_replace($row->word, $row->char_word, $tag_input);
}
which will replace every single instance of your word-column with the corresponding value in the char_word-column.


Messages In This Thread
Calling a database to make an array string - by El Forum - 09-01-2012, 06:54 PM
Calling a database to make an array string - by El Forum - 09-01-2012, 07:17 PM
Calling a database to make an array string - by El Forum - 09-01-2012, 07:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB