Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Array
- (
- [:uid] => 1
- [:content] => kjgrliueajrghkerg
- [:ip_address] => 127.0.0.1
- [:privacy] => 0
- )
- Array
- (
- [ok] =>
- [msg] => SQLSTATE[HY093]: Invalid parameter number: :content INSERT INTO s0cF_posts (user_id, post_content, ip_address, privacy) VALUES ( :uid, ':content', ':ip_address', :privacy )
- )
- This is the post function that is returning this response:
- function post_status( $uid, $privacy, $content ) {
- $content = pg_escape_string($content);
- $ip = $_SERVER['REMOTE_ADDR'];
- $prepared = $this->prepare( "INSERT INTO ".TP."_posts (user_id, post_content, ip_address, privacy) ".
- "VALUES ( :uid, ':content', ':ip_address', :privacy )" );
- $post_array = array(
- ':uid' => $uid,
- ':content' => $content,
- ':ip_address' => $ip,
- ':privacy' => $privacy );
- print_r($post_array);
- try {
- $this->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- $this->beginTransaction();
- $prepared->execute( $post_array );
- echo $prepared->queryString;
- $post_id = $this->lastInsertId('post_id_seq');
- $post_meta_array = array(
- ':direct_link' => "posts/$uid/$post_id");
- $prepared = $this->prepare( "INSERT INTO ".TP."_post_meta () ".
- "VALUES ( 'direct_link', ':direct_link' )" );
- $prepared->execute( $post_meta_array );
- } catch ( PDOException $e ) {
- $db_err = $e->getMessage();
- $this->rollBack();
- $response = array(
- 'ok' => false,
- 'msg' => $db_err." ".$prepared->queryString );
- return $response;
- }
- $this->commit();
- $response = array(
- 'ok' => true,
- 'msg' => "Success! $prepared->queryString" );
- return $response;
- }
- "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement