sitcom

A

Anonymous

Guest
Hi all,
I have recently downloaded a program called sitcom, which if installed on my server correctly will perform miracles ( i am told ) lol, anyway 2 things have stumped me, any suggestions gratefully received.....
1.
class OpenDbaseConnection {

//define properties
//define properties
var $localdb="deltaforceone";
//var $localuser = "deltaforceone";

//var $localpassword = "mypassword";

var $localhost = "localhost";
var $websiteUrl = "myweb";
var $mysql_link;
var $result;
var $err;
var $error_num;

function OpenDbaseConnection()
{


$this->mysql_link = mysql_connect($this->localhost, $this->localuser, $this->localpassword);

With the correct settings in the localhost,user and pass vars it comes up with an error when connecting.

2.
//perform the search
$y = 0;//ensures that each record found is stored to its unique location
//they can be retrieved with the syntax $object name->SearchResults[0]['FIELDNAME']
$mysql_result = mysql_query($select_Statement , $mysql_link);
//retrieve query

if($query_type_flag == "SEARCH")
{

while($row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
{

$rowlength = count($row);


for($x=0;$x<$rowlength;$x++)
{

The line in red text creates an error.
 
obviously your $select_statement within your passed query clause is yielding a null result -

amend the query that you pass to the database wrapper as the error isn't truely within the class and declarations, it is within the terms you pass to the wrapper.

subnote: why are you using a database class wrapper if you cannot debug something so primary? why not just use procedural calls until you are competent with the language?
 
I am using a database class wrapper (if thats what its called) because the description of the program suited my needs. If a program description suits my needs then i tend to try and use it... if along the process i come across a few problems then i tend to visit php forums to get some help from more experienced programmers, hopefully then, the next time i face the same sort of problem i can sort it out for myself.

Voilla i have learnt something :lol:

I thank you for your reply to my post but in all honesty i hope that someone out there will reply in a language that a noob like myself can understand. :oops:

I'm sure that if you werent such a nice person you would have put "if you cannot debug something so god damned simple?"
 
pootergeist said:
subnote: why are you using a database class wrapper if you cannot debug something so primary? why not just use procedural calls until you are competent with the language?

I believe he has stated that this is a program that fits his needs. Meaning he is not the programmer. So debugging the application is not his job. He has a simple question he has come to the "experts" with on trying to make it work. I don't appreciate your comment. This forum was intented on HELPING others. Not to point out the shortcomings of others.

scorpion said:
//var $localuser = "deltaforceone";

//var $localpassword = "mypassword";

These lines are commented out. PHP does not read any lines that start with // so those variables are not being used so it is sending a blank username and password

Also what is the error that you receive?

Is there a URL for the program that you are trying to use so we can see the full source or documentation.
 
If i could type in an embarrassed way then i would, :lol:

Thank you Red for your comments and your solution to the login, thats that one sorted.

As i said in my previous post, i've learnt something..get rid of the // thingys, :D

Can i now draw your attention to my second problem that i did address in my first post.

2.
Code:
//perform the search 
$y = 0;//ensures that each record found is stored to its unique location 
//they can be retrieved with the syntax $object name->SearchResults[0]['FIELDNAME'] 
$mysql_result = mysql_query($select_Statement , $mysql_link); 
//retrieve query 

if($query_type_flag == "SEARCH") 
{ 

while($row = mysql_fetch_array($mysql_result, MYSQL_ASSOC)) 
{ 

$rowlength = count($row); 


for($x=0;$x<$rowlength;$x++) 
{

the error i get is:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/deltaforceone/www/sitcom/classes/core/dbase_mod.php on line 141
Line 141 is while($row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))

Any idea's

Thank you all
 
Back
Top