Don't use RAW SQL with mysql_* function. It is not the aims of this framework.

You can do :

[...]
$file = FilePeer::doSelectOne($c);

if($file instanceof File) {
 return $file->getFilePath();
}

return null
[...]


If you use doSelectOne, you don't have to call setLimit ...
if you use doSelectRs, this return a collection of ResultSet, to get
the first entry, use $rs->next()
if you use doSelect, this return an array of File

You sould read the propel documentation. And if you are at the point
to write raw SQL, read this
http://propel.phpdb.org/docs/en/user_guide/chapters/FindingObjects.html#WritingSQL
.

Thomas

On Sun, Apr 6, 2008 at 10:33 PM, Jill Elaine <[EMAIL PROTECTED]> wrote:
>
>  I realized I was making my selection criteria much more complicated
>  than I need. I wrote the function with sql and can see more clearly my
>  criteria:
>         public function getFilePath()
>         {
>                 $fileid = $this->getFileId();
>                 mysql_connect("localhost","myuser","mypassword");
>                 mysql_select_db("mydb");
>                 $getfilepath = "SELECT file_path FROM file WHERE file.id = 
> $fileid";
>                 $run = mysql_query($getfilepath);
>                 $row = mysql_fetch_assoc($run);
>                 $filepath = $row['file_path'];
>                 return $filepath;
>                 mysql_close();
>         }
>  This works well, and I can use return instead of echo. Okay, this
>  propel language is so foreign to me! I'll keep learning and rewrite my
>  sql statements someday...when I get smarter!
>
>
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to