You are here: Re: Dumbfounded « PHP Programming Language « IT news, forums, messages
Re: Dumbfounded

Posted by Justin Koivisto on 02/23/06 00:52

Sheldon Glickler wrote:
> I have a script, testsql.php that I run and it works well.
>
> Here are the guts:
>
> session_start();
> require_once("sqlLoginDB.php");

If this is going into a function or included file, it should be an
absolute path. For instance, if the sqlLoginDB.php file is lcoated in
the same directory where this code is found, you should use:

require_once dirname(__FILE__).'/sqlLoginDB.php';

That way, no matter what the current working directory is, the file can
be found.

> mssql_select_db($database_apbLogin, $apbLogin);

No mssql_connect? IF you paste this into a function, you will need to be
sure that you are referencing your db connection either through $GLOBAL
or explicitly define it as global in the function. You should also check
to see that the call succeeded by checking it's return value.

> $_SESSION['curSpeaker'] = '1000129';
> query = "SELECT * FROM speakers WHERE iOldSpeakerId='" .
> $_SESSION['curSpeaker'] . "'";
> $result = mssql_query($query, $apbLogin);// or die(mssql_error());
> echo "Result: " . $result;

You may want to try something like:

if(!is_resource($result)){
// there was a query error of some sort
return mssql_error();
}else{
// the query was a success
}

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация