/**
* @param $item
*/
function my_custom_function( $item ) {
wp_dropdown_users( array(‘show_option_none’ => __(‘No user selected’) ) );
}
add_action( ‘wpim_admin_pre_edit_item’, ‘my_custom_function’ );
This code is generating my User list drop-down on the inventory pages.
I don’t have a lot of experience with mySQL, but I’m assuming I need to save it to a database using POST somehow? I’m not much of a back-end coder so I’m just kind of lost at how to tackle this.
]]>after updateing PHP 5.6 to an Higer Version (7.0, 7.4 or 8.0) my WordPress installtion give me the follwing error :
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at 127.0.0.1 could not be established. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
When i go back to 5.6 everythin works fine.
I have tried to search for the error but the solutions i′ve found are more related to specific error messages. Since this message is very mysterious to me (DB, user and password are correct) I am a bit at a loss. Cloud somebody give me an hint please ?
]]>Many thanks
]]>I want to add my own PHP code to retrieve information from a MySQL database As well I want to be able to add and update records into that MySQL. I’ve developed the PHP code already on a basic flat (no WordPress) web-site and now I want to integrate it into WordPress. How can this be done? Any suggestions?
Thanks, Rene.
]]>$query = "SELECT * FROM techs WHERE 1";
$q = mysql_query($query) or die(mysql_error()); ?>
<select name="tech">
<?php while($row = mysql_fetch_assoc($q)) { ?>
<option value="<?php echo $row['TechID']; ?>"><?php echo $row['techname']; ?></option><?php } ?>
</select>
It works on it’s own (here), but when I use the same code block on a WP page I get outward-facing HTML like so:
<select name='tech'>
<option value="">
</option>
</select>
When I echo $q I get a resource link identifier, and even doing mysql_num_rows in an echo gives the correct result. So I’m at a loss as to why the code is breaking. Any help would be appreciated.
]]>i’ve a brand new server on which i freshly installed Fedora Core 5 linux and tried to set up a wordpress. i didn’t managed to make it work, so if there are users out there that achieved to do it, i’ll be glad to hear from them. As far as i can see, it’s a PHP/MySQL probem, but here’s the story of my problems:
– apache (2.2) comes pre-configured w/ php (5.1) support, and i installed via yum the php-mysql package. i created a MySQL (5.0) table+user for WP, and then untared the last WP tarball (2.0.2), and tried to visit the wp-install.php url. the page loads, but i only got an error message saying my PHP installation is missing the mysql module (i’m posting from the office and don’t have the message text at hand).
– by grepping into the WP directory i achieved to get where the message comes from : wp-settings.php . there’s a pretty test to test if the mysql.so module is included in php. the PHP version in FC5 is 5.1. i cheched into php.ini, /etc/php.d/mysql.ini and AFAIK the module seems to be declared. i tried to declare it once more, but then running “php -v” warns me that it’s loaded more than once. so i suppose the module is loaded.
– just to be sure, i installed PHPMyAdmin and verified that i can see my WP table through it. i don’t know if it’s using the same module, but the fact is i can get access to mysql with it
– at that point i supposed the problem might be that PHP 5.1 changed the mysql module name, but commenting the check in the code just leads me to a blank page.
i’m now short of ideas, so your support will be greatly appreciated!
thanx
oDDsKooL
]]>