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

php query problem...

 
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
mcjules
Smarty n00b


Joined: 01 Mar 2004
Posts: 1

PostPosted: Mon Mar 01, 2004 12:32 am    Post subject: php query problem... Reply with quote

Hello,

I don't think my problem is related to Smarty... I have a php error before I get any debug window from smarty.
Anyway, I can't figure out what's wrong with this very basic query, so I thought you might !

Here is the code:

<?
// tutorial.php
#include "/Library/WebServer/Documents/smartytut/functions.inc";
require '/usr/lib/php/Smarty.class.php';

#variables mysql
$utilisateur = "root";
$motdepasse = "";
$base = "authentication";
$hote = "localhost";

$smarty = new Smarty;

#connexion à la base
dbconnect ($utilisateur, $motdepasse, $base, $hote);

#requete sur la base
$query = "select * from people";
$people = sql_query($query);

#remplir l'objet smarty et afficher
$smarty->assign('people', $people);
$smarty->display('tutorial.tpl');

#fermer connexion
mysql_close();




function dbconnect ($utilisateur, $motdepasse, $base, $hote) {
$connexion = mysql_connect($hote, $utilisateur, $motdepasse) or die("Unable to connect to database");
@mysql_select_db($base, $connexion) or die( "Unable to select database");
}


function sql_query ($query) {
  $result = mysql_query($query);
  $return_array = array();

  while ($row = mysql_fetch_array($result)) {
     array_push($return_array, $row);
  }

  mysql_free_result($result);

  return $return_array;
}

?>


It says "Parse error: parse error in .....Documents/smartytut/tutorial.php on line 38".
I can't figure out where the error comes from.

Thank you very much in advance for taking a look at my code !
Julien
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Mar 01, 2004 1:26 am    Post subject: Reply with quote

hmm. I couldn't reproduce this problem. Question
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