Jump to content

lional

Members
  • Content Count

    271
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lional

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Hi, thanks, did some rough calculations and that should work, thanks a million
  2. Hi I am busy with a word press and I need to add leading zeros to a number in javascript so that for example 9 becomes 0.00009, and 30 becomes 0.00030 and 560 becomes 0.00560. I am very new to Javascript. I have been looking at the pad left functions. Is this the correct function or is there another one. Any help will be much appreciated
  3. Thanks for your input, I made some alterations since my post, still not working but I think I am closer. I moved my functions to the functions.php in my theme. Here are my two functions function getTierBLOne() { global $wpdb; $maincats = $wpdb->get_results( "SELECT * FROM nova_tp_forex_main_cats ORDER BY forex_name ASC" ); //$result_query = mysqli_query($conn,"SELECT * FROM nova_tp_forex_main_cats ORDER BY forex_name ASC"); //while ($tier = mysqli_fetch_array($result_query)) foreach($maincats as $maincat) { echo '<option value="' . $maincat->forex_id .'">'.$m
  4. Sorry, I have another function page <?php //************************************** // Page load dropdown results // //************************************** function getTierBLOne() { include 'includes/conn_db.php'; $result_query = mysqli_query($conn,"SELECT * FROM nova_tp_forex_main_cats ORDER BY forex_name ASC"); while ($tier = mysqli_fetch_array($result_query)) { echo '<option value="'.$tier['forex_id'].'">'.$tier['forex_name'].'</option>'; } } //************************************** // First selection results // //*****************************
  5. Hi All I am trying to write chained selects for a WordPress plugin I am busy with. I have been struggling with it for a few days because my ajax is very weak. This is my file plugin file: <?php function js_enqueue_scripts() { wp_enqueue_script ("nova-ajax-handle", get_stylesheet_directory_uri() . "js/nova-ajax.js", array('jquery')); //the_ajax_script will use to print admin-ajaxurl in custom ajax.js wp_localize_script('nova-ajax-handle', 'nova_ajax_script', array('ajaxurl' =>admin_url('admin-ajax.php'))); } add_action("wp_enqueue_scripts", "js_enqueue_scripts"); ?&g
  6. Hi All I am trying to write a page to have a similar effect as the following page http://www.pht.co.za/about.php Is there tutorials that I can have a look at to figure out how to accomplish it. I have been trying to do it but my main problem is that when I hover over a menu item on the left the content must change and that content must remain until I hover over a new menu item. I am not asking that this be done for me because then I will not learn just to point me in the right direction Any help will be appreciated
  7. Thanks, I will look and see why it is doing that and try to rectify it
  8. Hi All I am converting my scripts from mysql to mysqli and I am having some difficulty $query = mysqli_query($conn,"SELECT * FROM products WHERE prod_id IN ("); foreach ($_SESSION['cart'] as $key => $value) { $query .= $key . ','; } $query = substr ($query, 0, -1) . ')'; $result = mysqli_query($conn, $query) or die(mysqli_error($conn)); while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) { } I get the following error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1111)
  9. Hi I am struggling a bit to convert mysql to mysqli and some things don't seem to be working and I have been battling for hours I have this code that gives me the following error message Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given while (($row = mysqli_fetch_assoc($result)) !== false) { $names[$row['user_name']] = $row['user_id']; return $names; } Thank you in advance
  10. Hi All I am busy changing from mysql to mysqli on my old scrips and I have one problem that I cannot seem to solve. <?php // checks a given username and password combination. function validate_credentials($user_name, $user_password) { $conn = mysqli_connect("localhost", "root", "", "hebron_college"); /*@mysql_select_db('hebron_college');*/ $user_name = mysqli_real_escape_string($conn, $user_name); $user_password = sha1($user_password); $result = mysqli_query($conn, "SELECT * FROM users WHERE user_name = '$user_name' AND user_password = '$user_password'"); $num = mysqli_num_row
  11. Hi I found this facebook like messaging system tutorial that seems to be just but what I need, however when I press the reply button to send the new message it seems to be stuck on that page I am attaching all the related code. The Script.js looks like this $(document).ready(function(){ /*post message via ajax*/ $("#reply").on("click", function(){ var message = $.trim($("#message").val()), conversation_id = $.trim($("#conversation_id").val()), user_form = $.trim($("#user_form").val()), user_to = $.trim($("#user_to").val()),
  12. Hi All I am trying to create a modal popup but I would like it to do the following 1. Load when the user enters the site, but only once not every time they navigate to a new page. 2. when they leave the site. again only when they leave the site not when they move from page to page. I am still busy on number 1 so I haven't started working on nr 2. I have got the popup part right but it loads every time the page is refreshed. I have been trying to play with cookies but then it doesn't load at all <script> if (once_per_session==0) $(document).ready(function() { if ($.cookie('20
  13. Hi I am trying to keep a tooltip on the page even when the user scrolls What I had in mind is keeping the the tooltip in a static position on the screen so as the user scrolls the position would stay teh same but for this to happen the margins would need to dynamically change. Here is my CSS so far /* Tooltip container */ .tooltip { /* border-bottom: 0px dotted black; If you want dots under the hoverable text */ } /* Tooltip text */ .tooltip .tooltiptext { border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow: 5px 5px 5px rgba(0,
  14. Hi I am trying to write a script that changes the background based on a navigation hover and I have got that part right. What I would like to further do is when I move off the navigation bar it remembers the last image, if this makes sense. Here is my code so far <nav> <ul> <li> <a href="#">Home</a> <img src="pic2.jpg" alt=""> </li> <li> <a href="#">About</a> <img src="pic3.jpg" alt=""> </li> <li> <a href="#">Clients</a>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.