jonesa01's Profile
Reputation: 25
Craftsman
- Group:
- Author w/DIC++
- Active Posts:
- 126 (0.06 per day)
- Joined:
- 18-February 07
- Profile Views:
- 4,113
- Last Active:
Apr 13 2012 11:33 AM- Currently:
- Offline
Previous Fields
- Country:
- Who Cares
- OS Preference:
- Windows
- Favorite Browser:
- FireFox
- Favorite Processor:
- Who Cares
- Favorite Gaming Platform:
- Nintendo
- Your Car:
- Who Cares
- Dream Kudos:
- 175
Latest Visitors
-
mrscurt 
05 Mar 2013 - 11:26 -
treef 
17 Apr 2012 - 11:59 -
Denis1 
15 Apr 2012 - 10:27 -
dabanx 
13 Apr 2012 - 12:04 -
ricardosms 
13 Apr 2012 - 04:06
Posts I've Made
-
In Topic: Sending information to database error
Posted 9 Apr 2012
I would also recommend having two different messages for mysql_conntect and mysql_select_db so you can see which function is not working correctly. -
In Topic: PHP+Wordpress Counter
Posted 3 Apr 2012
Ah, if it in a page added through wordpress rather than the template add this code to just above the displayCounter function
add_shortcode('displayCounter','displayCounter');
And just put this on the wordpress page: [displayCounter] -
In Topic: PHP+Wordpress Counter
Posted 2 Apr 2012
Firstly make sure there is no spaces in the <?=displayCounter();?> code, and make sure the template where you are adding it to is PHP like header.php -
In Topic: Unable to retrieve image from database
Posted 2 Apr 2012
The main option I can think of is to have two seperate files one which has the table and the other which displays the image.
<?php $hostname = "shopbyclickorg.ipagemysql.com"; $username = "shopbyclickorg"; $password = "*********"; if(!($link = mysql_connect($hostname,$username,$password))) die("Could not connect to database."); $databasename = "e_commercedb"; if(!(mysql_select_db($databasename,$link))) die("Could not open table."); $result =mysql_query( 'select * from product'); print "<table>"; while ($row = mysql_fetch_array( $result )) { ?> <tr> <td width ="60" height ="60"> <img src="images.php?id=<?=$result["id"];?>"> </td> </tr> <?php } ?>
image.php
<?php $hostname = "shopbyclickorg.ipagemysql.com"; $username = "shopbyclickorg"; $password = "*********"; if(!($link = mysql_connect($hostname,$username,$password))) die("Could not connect to database."); $databasename = "e_commercedb"; if(!(mysql_select_db($databasename,$link))) die("Could not open table."); $result =mysql_query( 'select * from product where id = '.$_GET["ID"].' LIMIT 1;'); $result = mysql_fetch_array($reult); header("Content-type: image/jpeg"); echo $result['image']; ?>
This code should do it. -
In Topic: PHP+Wordpress Counter
Posted 2 Apr 2012
As you have trouble with this I suggest you consider creating a plugin for this. Which would enable you to fairly easily change templates.
so in the wp-contents/plugins/ create a new folder called travelcounter and inside there make a file called travelcounter.php and save the code in it:
<?php /* Plugin Name: TravelCounter Plugin URI: Description: Version: 1.0 Author: Author URI: */ function displayCounter(){ // your code goes here } ?>
Then activate the plugin in the wordpress plugin section.
And in the template wherever you want it to go just place this code <?=displayCounter();?>. So if you change template all you need is to put that bit of code in the place you want it.
My Information
- Member Title:
- D.I.C Head
- Age:
- 23 years old
- Birthday:
- September 1, 1989
- Gender:
-
- Location:
- Manchester, UK
- Years Programming:
- 8
- Programming Languages:
- JavaScript, CGI/Perl, Pascal, HTML, DHTML,VBScript, Java
Contact Information
- E-mail:
- Private
- Website URL:
-
http://www.apje.org
Friends
jonesa01 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
jonesa01 has no profile comments yet. Why not say hello?