# Calling php from mysql

**URL:** <https://forum.kirupa.com/t/calling-php-from-mysql/232518>\
**Category:** Uncategorized\
**Created:** [July 15, 2007, 2:14am UTC](https://forum.kirupa.com/t/calling-php-from-mysql/232518 "2007-07-15T02:14:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexguz79](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@alexguz79](https://forum.kirupa.com/u/alexguz79)\
**Post date:** [July 15, 2007, 2:14am UTC](https://forum.kirupa.com/t/calling-php-from-mysql/232518/1 "2007-07-15T02:14:06Z")

</div>

hey everybordy

i’m having a problem calling a php file from the ddbb

case:

i have a news system and want to add comments to each news i have… ddbb records every news and i have this \*\*.php file i generate for every single news…

im trying to call that file into a php file as part of the news page… the thing is i’m having error over an over…

here’s my code… maybe you can help… or maybe tell me a better way to do it

## code

\<?php  
require\_once(‘config\_news.php’);  
$sql = ‘SELECT \* FROM single\_news WHERE ID = ‘.mysql\_real\_escape\_string($\_GET[‘id’]);  
$query = mysql\_query($sql) or die(mysql\_error());  
$row = mysql\_fetch\_assoc($query);  
?\>  
\<? define(‘IN\_SCRIPT’, ‘true’); $script\_root = ‘./’; include($script\_root . $row’[php\_file]’); ?\>
