Need Help Getting Application Working


I have an application i have been trying to get runing under DH for a while now, now I really need to get this working. Any help is greatly appreciated.

I have an internal app we use and it is runing fine on the internal WAMP server. It is now time to take it to an external host but I am having a few issues. It seems like MySQL issues but not 100% sure.

Is the domain I am installing it to. One of the errors there is:

“Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.laverne/ckikea/ on line 34”

The code on that line is:

33: $branches = mysql_query(“select * from branches where branchType = ‘physical’ ORDER BY branch”);
34: $numBranches = mysql_num_rows($branches);

Any ideas what is going on here?

Thanks In Advance!!!


The error is almost certainly the result of a problem with your database connection (the “resource” the query needs).

Max discount on any plan with promocode SCJESSEYTOTAL


The first error I’m seeing is that it can’t connect to the SQL server. Do you have a database set up? You can’t use ‘localhost’ for the server name. It should be something like, which is how I name my database servers when I set up a database.

As a side note, which version of MySQL were you running before? You may run into a compatibility issue as well.



I can login in fine and use some of the applications functions. Trying some other things generates similar MySQL errors.

What would be the best way to see what is going on?


A Google search came up with this:



Sometimes I find it helpful to use phpMyAdmin interactively to test queries and troubleshoot. You can log into an instance of phpMyAdmin for your database by browsing directly to your host and providing your db user/pass.



I am running MySQl 5.0 on the local server. A DB is setup on the DH servers and I have changed the conection file to reflect this.

I can login which pulls the user/pass from the DB. I can also search for names in the application but do get MySQL errors. Kinda stumped here.


[quote]33: $branches = mysql_query(“select * from branches where branchType = ‘physical’ ORDER BY branch”);
34: $numBranches = mysql_num_rows($branches);[/quote]
It might help if there was a bit of error capturing going on. After all, mysql_query returns FALSE if there was an error.

$statement = ‘SQL GOES HERE’;
$result = mysql_query($statement);
if ($result === FALSE)) {
$error_message = mysql_error();
die('Database error: " . $error_message . " File: " . FILE . " on line: " . LINE);
$branches = $result;
$num_branches = mysql_num_rows($branches);

In otherwords don’t assume what was returned by the first function is indeed what you need to pass onto the second function when the documentation says the result value maybe of more than one type. In this case the mysql_query functiuon can return a ‘resource’ or a ‘boolean’ (the FALSE value).

:cool: -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


I have enabled some more MySQL error showing.

It is now displaying things such as:

Warning: mysql_query() []: Table ‘ytrackdemo.yConfiguration’ doesn’t exist in /home/.laverne/ckikea/ on line 29

I know the table and the data it needs do exist. I can login to PHPMyAdmin view and query the data fine.

I’m sure it is some small configuration or compatibility issue but not sure what. :frowning:


I noticed from the error message that the table listed is:


I noticed that the C is capital. Do you think it could be a problem with the table name being case-sensitive?


I looked at the code and the line that it is getting an error on is:

$qryData = mysql_fetch_array(mysql_query(“select description from yConfiguration where yItem = ‘country’”));

It looks fine and the query works fine in PHPMyAdmin and on the local server. Some MySQL queries work others do not that should. Very stumped here.

I did notice in phpMyAdmin at the bottom it says:

The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.

Could that be related?