Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Two Function on one page

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Ldragon99
Smarty n00b


Joined: 09 Dec 2015
Posts: 1

PostPosted: Wed Dec 09, 2015 11:20 pm    Post subject: Two Function on one page Reply with quote

My site just updated to PHP5.5 and some of my function broke.

I have a plugin page called function.get_text.php

On that page I have a function:
if($_REQUEST['id']=='update')
{
smarty_function_update_text($_POST);
}

function smarty_function_get_text($params, &$smarty)
{
$str = $params['vbstring'];

$mysqli = new mysqli(HOSTNAME, DBUSER, DBPASS, DATABASE);

/* check connection */
if (mysqli_connect_errno()) {
$output=("Connect failed: %s\n". mysqli_connect_error());
exit();
}

/* Create table doesn't return a resultset */
if ($query = $mysqli->query("SELECT text FROM Kc_EN WHERE text_name = '".$str."' LIMIT 1")) {
$result = mysqli_fetch_array($query);
$output = $result[0];
}

return $output;

}

That works fine, however right under it I have a 2nd function that when on the page makes the whole page not work.

function smarty_function_update_text($_POST)
{


}
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP