Pirata Nervo
NervOS Developer
Posts: 699.4765 Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
|
RE: Help with textarea in html
i guess im doing something wrong because it isn't working =/
code:
|
|
12/11/2007 03:55 PM |
|
ZiNgA BuRgA
Smart Alternative
Posts: 17,022.2988 Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
|
RE: Help with textarea in html
Well, firstly, the SQL query is just, erm, totally wrong... I don't know what you're trying to do.
Are you trying to update the table with $itemarray?
MyBB has an update function for that...
I don't know where you want to place the new line, so I cannot help you there.
Also, I believe the MySQL table's field must be set to TEXT, as opposed to VARCHAR to accept newlines... (not certain though).
|
|
12/11/2007 07:08 PM |
|
Pirata Nervo
NervOS Developer
Posts: 699.4765 Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
|
RE: Help with textarea in html
no no no, the sql part is ok, everything works, i declared the $this and the itemarray, everythign is ok, but the \n is not working XD, im changing from VARCHAR to TEXT then.
|
|
13/11/2007 02:43 AM |
|
ZiNgA BuRgA
Smart Alternative
Posts: 17,022.2988 Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
|
RE: Help with textarea in html
Actually, from what I can tell, your SQL doesn't make sense...
|
|
13/11/2007 03:57 AM |
|
Pirata Nervo
NervOS Developer
Posts: 699.4765 Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
|
RE: Help with textarea in html
maybe because you don't know what i want to do lol.
also, im not using that anymore, but damn it's not working with TEXT instead of VARCHAR.
New code:
i get this error from mysql:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /www/freeweb7.com/p/e/r/perfectpredicament/htdocs/forums/inc/class_shop.php on line 109
(the line 109 and 110 is the
"items" => "'".intval($mybb»mybb»user['items'])."' \n\n '".$this»db»escape_string($itemarray['name'])."' \n '".$this»db»escape_string($itemarray['download'])"'",
"money" => "'".intval($mybb»mybb»user['money'])."'-'".intval($itemarray['price'])"'",
(This post was last modified: 13/11/2007 04:34 AM by Pirata Nervo.)
|
|
13/11/2007 04:34 AM |
|
ZiNgA BuRgA
Smart Alternative
Posts: 17,022.2988 Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
|
RE: Help with textarea in html
Pirata Nervo Wrote:
Uhh, erm...
The thing is, that's not a string.
You're putting the newline characters, outside of the string, which makes no sense.
(also, double quoting, wrong PHP syntax etc etc)
Try this:
Note that I'm presuming the code sample exists within /inc/db_mysql(i).php - that is, $this represents the $db object.
(This post was last modified: 13/11/2007 04:42 AM by ZiNgA BuRgA.)
|
|
13/11/2007 04:39 AM |
|
Pirata Nervo
NervOS Developer
Posts: 699.4765 Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
|
RE: Help with textarea in html
thanks, no errors on that lines now, but this is how it should be: (the $this isn't the $db object)
error on line 114 ($db»update_query(TABLE_PREFIX."users", $items_array, $where_items); )
Fatal error: Call to a member function update_query() on a non-object in /www/freeweb7.com/p/e/r/perfectpredicament/htdocs/forums/inc/class_shop.php on line 114
|
|
13/11/2007 04:59 AM |
|
ZiNgA BuRgA
Smart Alternative
Posts: 17,022.2988 Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
|
RE: Help with textarea in html
Oh I see what it is. You have a class, which has a copy of a global class declared privately. double you tee eff?
You should just use the global object - much neater, and better.
Ah well.
Change the $db line to $this»db then.
|
|
13/11/2007 05:16 AM |
|
Pirata Nervo
NervOS Developer
Posts: 699.4765 Threads: 39
Joined: 20th Jun 2007
Reputation: -0.79225
E-Pigs: 19.2466
|
RE: Help with textarea in html
i didn't make the plugin, I'm modifying it, well almost everything was modified lol.
but damn i forgot to change that one ! lol thanks
but still not working lol
this is my sql part to add the items column
|
|
13/11/2007 12:05 PM |
|
ZiNgA BuRgA
Smart Alternative
Posts: 17,022.2988 Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.1274
|
RE: Help with textarea in html
Pirata Nervo Wrote:
Either change it to $this»db, or use global $db;
|
|
13/11/2007 03:33 PM |
|