Ashfaq Ahmed Nizamani
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: Mixing WordPress plus my own PHP codeThank you very much All.
I have done it. I know how to list all records, delete specific record, insert a record, search a record and sort records.Yes all in a page or in a custom template page.
Now I understand how to work with MySQL databases from independent php files or from wordpress pages. The two approaches are bit different. The first one gives you quite independence while the other has some restrictions. The methods of $wpdb are sufficient to design any kind of database you like as long as you work inside the same database which WordPress uses.
Forum: Everything else WordPress
In reply to: Mixing WordPress plus my own PHP codeHi,
It seems every one is so busy these days that no one has time to give a helping hand!I am trying to work with MySQL from within a Page of WordPress but so far not successful. Although I can create a link inside the page and call a php file and then that php file takes over and every thing works fine. This means I can even work with MySQL as well. I have done this.
But what I really want is how to use the same working php code inside the wordpress page. I have tried couple of plugins. Such as (insert PHP) for insert the php code within the wordpress page but this again does not allow to work with MySQL. Tried even inserting the code inside a template page but even then it does not work.
Tried and created a simple plugin and used the same code inside that plugin of my own but the issue remains the same. The database connection does not materialize.
Please HELP!!!
Here is the code I am using:
<?php
DEFINE (‘DB_USER’, ‘root22’);
DEFINE (‘DB_PASSWORD’, ”);
DEFINE (‘DB_HOST’, ‘localhost’);
DEFINE (‘DB_NAME’, ‘sitename’);$dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die (‘Could not connect to MySQL: ‘ . mysqli_connect_error() );
mysqli_set_charset($dbc, ‘utf8’);
echo ‘<h1>Registered Users</h1>’;
$q = “SELECT CONCAT(last_name, ‘, ‘, first_name) AS name, DATE_FORMAT(registration_date, ‘%M %d, %Y’) AS dr FROM users ORDER BY registration_date ASC”;$r = @mysqli_query ($dbc, $q); // Run the query.
$num = mysqli_num_rows($r);if ($num > 0) {
echo “<p>There are currently $num registered users.</p>\n”;echo ‘<table align=”center” cellspacing=”3″ cellpadding=”3″ width=”75%”>
<tr><td align=”left”><b>Name</b></td><td align=”left”><b>Date Registered</b></td></tr>’;while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
echo ‘<tr><td align=”left”>’ . $row[‘name’] . ‘</td><td align=”left”>’ . $row[‘dr’] . ‘</td></tr>’;
}echo ‘</table>’;
mysqli_free_result ($r);
} else {
echo ‘<p>There are currently no registered users.</p>’;
}
mysqli_close($dbc);
?>Forum: Everything else WordPress
In reply to: Mixing WordPress plus my own PHP codeWell something like that. What I really mean is that when I integrate by calling one of the php from one of the page inside wordpress it works. But if I can not call those php files from within wordpress php files.
May be like plugin, because plugins work just fine. Although I know a little bit of creating my own plugin do you recommend to use my php code by using those inside a plugin?
Forum: Themes and Templates
In reply to: [Simone] no more margin for the text after updated@morten Rand-Hendriksen
Theme Simone DeveloperI am new but that does not stop me from learning. I have found one little hitch in your free lectures on the above theme. Since I could not find your contact (though sent an instant message on facebook, probably inactive) I am sending you here. My apologize to all because this is not the correct way to say.
It was all fine upto chapter 7. Problem arose when followed lesson 1 chapter 8. (Now resolved it) The issue was bit odd. I followed the lesson and applied as suggested but the result was not as described. Tried enough for the last two or probable three days. Finally re-attended your lecture 1 chapter 8. What I found was surprisingly very simple but important. Throughout chapter 1 to 7 your lectures were on the Home page of the web site. But this was an issue for the lesson 1 chapter 8. I notcied (after attending the lecture 8th time) that the URL mentioned in the lecture was not of the main page or Home page rather a specific post. So I tried that. Look what happened the problem I was facing was solved. That is what was I think for a newcomer like, missing in the lecture. Probably you should have talked about that URL specificity in the lecture. Even though it is simply a gift for people like me to have a free lectures.
Thanks
https://www.ads-software.com/support/topic/footer-widgets-dont-display-properly-in-chrome?replies=2
Forum: Themes and Templates
In reply to: [i-transform] Footer widgets don't display properly in chromeThis is what I have noticed:
The theme is functioning fine with FF(33.1.1)
The theme is not functioning fine with Google Chrome (Version 39.0.2171.71 m)As you said the issue is js because it is the behavior that is causing some trouble in the google chrome. I am not an expert but issue is definitely related to the cross-browser compatibility issue.
The issue become resolved once you scroll back to the top and then come back to the footer in the chrome but it is an ISSUE that needs attention.
Forum: Themes and Templates
In reply to: Single.php is not in action rather index.phpI have resolved it. Although it is bit odd as I said I am new.
How I solved it?
Well when I followed the lecture in the above given link (in the question) I found that the url in the video was (https://localhost) throughout first seven chapters. But in the lesson 1 of chapter 8 I have noticed that the url is now (https://localhost/template-sticky) and that is really odd for me. Because when ever I had been visiting my website on my local machine I had been getting the home page (which is not a page defined in the page) rather a custom page with its menu name being defined in the menu and it is always selected by default or when I hit the title.
I am still bit perplexed for what I have just found. So what I noticed in the url and applied the issue was resolved. Now the changes being applied can be seen and it means that the single.php>content-single.php duo are in action and not the default index.php
What I have understood is this: When one select a post from the default custom page (a landing page) then we can see the actual effects of changes that have been applied to the content-singple.php
I WILL APPRECIATE ANY COMMENTS.
Thank you all