chrometweaks.org

Can I change my iPage domain to a new name?

Click Here To View All Answers...


Question I have... Can I change my iPage domain to a new name? Looking forward for any comment. My other question... I have added a new table to my database, and everything works well. However on the admin/index page I basically want to show a simple bit of text if there is anything in this table. I have the following php code in my index page..

$shipping_quote = tep_db_query("select count(*) from  "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote['total'] < 0 ) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

 <tr class="infoBox">.

   <td class="infoBox">Quotes Waiting</td>.

 </tr>.

</table>');.

}.

However the "Quotes shipping" shows up if there are items in this table or not!.

I cant work out what I am doing wrong...

Comments (108)

Of course! although you might want to make sure and wait for someone else to confirm my answer as I am not confident. Better yet, why don't you ask the iPage guys because they can assist you better...

Comment #1

Hi Paul.

Try the following.

$shipping_quote_query = tep_db_query("select count(*) as total from  "TABLE_REQUEST_SHIPPING));.

$shipping_quote = tep_db_fetch_array($shipping_quote_query);.

If ($shipping_quote['total']  > 0 ) {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

  <td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

That should do it..

Comment #2

Mark,.

I tried what you reccomended but got a parse error on line 132 which is CSS lines of admin/index so I'm not sure what happened there. I I removed one of the double ) and that seemed to work. THi is what I mean.

$shipping_quote_query = tep_db_query("select count(*) as total from  "TABLE_REQUEST_SHIPPING);.

$shipping_quote = tep_db_fetch_array($shipping_quote_query);.

If ($shipping_quote['total']  > 0 ) {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

 <td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

However after running it I still get the quotes waiting text even though the table is empty..

I echoed shipping_quote.

And just got 'Array' returned..

If I try Emmets suggestion with.

If ($shipping_quote['total'] <= 0 ) echoing shipping_quote returns.

'Resource id#32'.

If I try.

If ($shipping_quote['total'] = Null).

And echo Shiping_quote I get.

'Warning: Cannot use a scalar value as an array in /home/penlan/public_html/admin/index.php on line 133'.

Any ideas..

This post has been edited by.

Hotnuts21.

: 10 March 2004, 17:29..

Comment #3

In case anyone is as lost as me, here is a run down of everything I have done so far.You will notice that I have added the echo shipping_quote to see what is being output..

$shipping_quote = tep_db_query("select count(*) from "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote == 0 ) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

Echo($shipping_quote);.

With an empty table the text still showed up, also echo output this.

"Resource id #32".

I also have tried a few other things, which have the same results. But different outputs with the echo..

$shipping_quote_query = tep_db_query("select count(*) as total from "TABLE_REQUEST_SHIPPING);.

$shipping_quote = tep_db_fetch_array($shipping_quote_query);.

If ($shipping_quote['total'] > 0 ) {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

} echo($shipping_quote);.

Text shows and the echo outputs "array".

I also tried.

$shipping_quote = tep_db_query("select count(*) from "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote <= 0 ) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

} echo($shipping_quote);.

Then the echo returns "Resource ID#32" and the text shows.

If I try.

$shipping_quote = tep_db_query("select count(*) from "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote = Null) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

} echo($shipping_quote);.

Then the echo returns nothing at all except the text quotes waiting. If I replace the IF statement with "if ($shipping_quote['total'] = Null)" I then get the text and.

"'Warning: Cannot use a scalar value as an array in /home/penlan/public_html/admin/index.php on line 133'".

Line 133 is nowhere near the bit of code I am putting in, it's a CSS style that appears in the heading of the page..

I also tried.

$shipping_quote = tep_db_query("select count(*) from "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote < 1 ) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

Echo($shipping_quote);.

And again I get the echo returns "Resource ID#32" and the text even though the table it empty.

This post has been edited by.

Hotnuts21.

: 10 March 2004, 18:01..

Comment #4

Hi Paul.

WHat happens when you try this.

$shipping_quote_query = tep_db_query("select count(*) as total from "TABLE_REQUEST_SHIPPING);.

$shipping_quote = tep_db_fetch_array($shipping_quote_query);.

If ($shipping_quote['total'] > 0 ) {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

<td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

Var_dump($shipping_quote);.

That should tell you whats in the array...

Comment #5

Ok the tables empty, but I still get the text. I also get this.

"array(1) { ["total"]=> string(1) "1" } "..

Comment #6

Try mysql.com - and let us know as I am interested in this ongoing saga..

Http://www.mysql.com/documentation/maxdb/4...261/content.htm.

Http://www.mysql.com/documentation/maxdb/4...261/content.htm.

This post has been edited by.

Yesudo.com.

: 10 March 2004, 21:05..

Comment #7

Do you want me to list a bit more of the index.php so you can see where I am including it, and also the table details?..

Comment #8

Ok I feel a duffos. Although I emptied the database table, half way through testing all of this someone put a quote through and put a item into the table.

So I thought the table was empty and it wasnt. After some re-testing I found this code definitely works ok..

$shipping_quote_query = tep_db_query("select count(*) as total from  "TABLE_REQUEST_SHIPPING);.

$shipping_quote = tep_db_fetch_array($shipping_quote_query);.

If ($shipping_quote['total']  > 0 ) {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

<tr class="infoBox">.

 <td class="infoBox">Quotes Waiting</td>.

</tr>.

</table>');.

}.

Sorry for all the hassles!!.

One thing that would be good though is to list the number the items in this table. I tried to add echo ($shipping_quote); but that just brings up ARRAY..

Can someone tell me how I can have the text above to read "Quotes Waiting 2" or however many are in the table. Thanks for your help so far guys..

Rgds.

Paul..

Comment #9

Thanks very much very helpfull. I hope I can return the favour sometime..

Rgds.

Paul..

Comment #10

I have added a new table to my database, and everything works well. However on the admin/index page I basically want to show a simple bit of text if there is anything in this table. I have the following php code in my index page..

$shipping_quote = tep_db_query("select count(*) from  "TABLE_REQUEST_SHIPPING);.

If ($shipping_quote['total'] < 0 ) {.

} else {.

Echo ('<table border="0" width="100%" cellspacing="0" cellpadding="2">.

 <tr class="infoBox">.

   <td class="infoBox">Quotes Waiting</td>.

 </tr>.

</table>');.

}.

However the "Quotes shipping" shows up if there are items in this table or not!.

I cant work out what I am doing wrong...

Comment #11

If ($shipping_quote['total'] = Null).

Or try echoing what the query returns when the table is empty..

This post has been edited by.

Yesudo.com.

: 10 March 2004, 16:37..

Comment #12


This question was taken from a support group/message board and re-posted here so others can learn from it.