334 Posted Topics
Re: Yes, agreed with @coreyavis and @diafol, you should probably research on the topic of turning images into javascript slider instead of 'php slider'. php only help to get the images and display it. The sliding effect, the time interval etc will all being control at client side(javascript) instead of server … | |
Re: `<?php the_content( $more_link_text , $strip_teaser ); ?>` is for wordpress usage. | |
Re: Use an `order by` query to sort your query result. Example: `select * from your_table order by category_type,category_parent,category_id` Then using a variable to store the data for comparism: $results = array(); foreach($your_result as $row){ $results[$row['category_type']][$row['category_parent']][] = $row['category_id']; } echo"<pre>"; foreach($results as $category_type => $parents){ echo "\n".$category_type; if(is_array($parents) && !empty($parents)){ foreach($parents … | |
Re: Your code on `$app_number+1` will auto cast the $app_number to integer for adding and will return the $app_number2 an integer value as well. Follow http://stackoverflow.com/questions/1699958/formatting-a-number-with-leading-zeros-in-php to add leading zeros to it. | |
Re: For me, I will not use the case of `$b = $last_id - 3;for($a = $last_id ; $a > $b ; $a--)`. Instead, I will use a while loop to do it $per_page = 3; $count = 0; while($count < $per_page){ $stmt = $conn->prepare("SELECT ID, Title, Author, Content FROM Posts … | |
Re: As from your code, `newcell.innerHTML=table.rows[1].cells[i+1].innerHTML;` this will duplicate the elements from the first row where the id of the elements will be duplicated as well. These result in the code for `var a=document.getElementById("keyword").value;` will always get the `<input type="text" name="keyword" id="keyword" >` of the first row and so as your … | |
Re: Try changing `$this->results = $this->execute->affected_rows;` into `$this->results = $this->connection->affected_rows;` | |
Actually, I am having problem with the wordpress lightbox plugin: Fancybox where it don't work. Therefore, I tried to change to jquery pirobox instead. But I having problem of add the custom rel and class to the link image. I refered [URL="http://wordpress.org/support/topic/add-relxyz-to-gallery-link"]http://wordpress.org/support/topic/add-relxyz-to-gallery-link[/URL] and tried without success moreover I want to … | |
I currently wish to write a query to duplicate data in database while modifying one column. First of all, my database structure: table code CURCD NOT NULL VARCHAR2(3) CODE NOT NULL VARCHAR2(2) ITEM NUMBER(1) DSCPT VARCHAR2(20) The unique idx is the curcd,code,item. What I wish to achieve is duplicate data … | |
Re: As I explained in https://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/494803/set-unique-id-when-adding-row-dynamically-, instead of `var a=document.getElementById("keyword").value;`, I think you need to catch which row of item user clicked and based on it, we only get the specific row of data instead of always the first row. | |
Re: http://www.percona.com/blog/2013/09/11/how-to-move-the-innodb-log-sequence-number-lsn-forward/ ![]() | |
Re: I think what you can do is `$sql = ("SELECT count(*) FROM Users where Username = '$username'");`. If the result return count > 0, means the username existed in database. This will be better practice as imagine if the Users table is populated with a few bils of data, it … | |
Re: Maybe you should var_dump($conn->lastInsertId()) before you use it in `for($a = $last_id ; $a > 0 ; $a--)`. As I checked in http://php.net/manual/en/pdo.lastinsertid.php, the pdo->lastInsertId() return string, cast it into integer before usage. | |
Re: Mind to show us how you store your `$_SESSION["cart_item"]` | |
Re: Change your codings for `if ($categories)` into `if (isset($categories) && !empty($categories))` Then `if ($category['children'])` using same feature and try again. | |
Re: From your code, I assumed your datatype returned from ajax_file.php is in html format. success : function( resp ) { $('#div_1').html($('#inner_1' , resp).html()); var result=('#div_2').html($('#inner_2' , resp).html()); alert(result);// the result here is an object where result = $('#div_2') } you should use the resp for the validation. And, I agree … | |
Re: What do you means by 'Now it is setting it to error'? Is it the connection error or the querying error? What my suggestion are, change your codes to show more specific errors: <?php $con = mysqli_connect("localhost","my_user","my_password","my_db"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " … | |
Re: I think what you want is $(document).ready(function(){ $("td[contenteditable=true]").blur(function(){ var msg = $(".alert"); var url = "update.php",; $.ajax({ url: url, type : 'post', data: $( this ).serializeArray(),//this will parse in the {id: $(this).attr("id"),value: $(this).text()} beforeSend: function(output){ msg.removeClass("hide"); }, success: function(output){ msg.addClass("alert-success").removeClass("alert-danger"); }, error: function(output){ msg.addClass("alert-danger").removeClass("alert-success"); }, complete: function(response){ msg.text(response); setTimeout(function(){msg.addClass("hide");},1000);//It will … | |
Re: Agree with @diafol. You can also check the user before executing delete query to prevent direct access using url. Example: `select id,user_name from agents where user_type = 'Admin'` Then after query, conduct an if-else case to check 1. if the id or user_name query is the same as $_SESSION data(depends … | |
Re: In your action link, add an the link with id attribute like `<a id="<?php echo $post['id'] ?>" href="#">Delete</a>` Then using an ajax to delete the row of data based on the link id's post['id'] and when successful, find the parent of the link again using the same id attribute and … | |
Re: I don't know about the idea of using <pre> tag, but normally what I done is, when post the textarea content to php, I tempt to use nl2br() to make sure the things stored to databased is already having the line break tag which makes my display part easier as … | |
Re: Try to review your code $query = "SELECT * FROM agents"; $query_confirm = mysqli_query($connection, $query); while ($record = mysqli_fetch_assoc($query_confirm)) { $id = $record["id"]; $uname = $record["agent_uname"]; $user_pass = $record["agent_password"]; $user_type = $record["user_type"]; } From what I see, you select all record from agents table and overwrite the $id,$uname,$user_pass,$user_type for each … | |
Re: Supporting @DaveAmour's comment. You probably set the id field into auto incrementing. What you should do to your work is don't display the ids to users and instead, display an index. $index = 1; foreach($result as $row){ echo "<tr class='tr'><td>" . $index . "</td><td> <a href='single-post-page.php?post=" . $row['ID'] . "'>" … | |
Re: Actually, the problem exist in the coding itself. As you see <?php function set_title($title){ echo $title; } ?> The function expect a parameter and the code calling it is `<title><?php set_title();?></title>` did not parse in the parameter to the function for it to echo. | |
Re: Wonder if I get the question correctly, you wish to seperate your full code into conn.php but wonder on how to made the try catch block to seperate itself? If so, try to understand what you wish to accomplish and try to understand the codes you written. If I am … | |
Re: These line of if($sql1) header('location:edit.php'); is the redirect function. Where this means that the `ajaxRequest.responseText` returns the html of your edit.php My suggestion is that changing the codes into `echo "success";` since the value is the inserted value, so we don't need to update the values into the field anymore … | |
Re: You may refer https://wordpress.org/support/topic/thumbnail-as-menu-item-1 for custom walker and parse in as argument in wp_list_pages($args) But be warn that the wp_list_pages will list all pages, what I suggest is using wp_nav_menu() to allow user customize their own nav bar content. | |
Re: Having a few question on you post before I can help: 1. Are you asking about the inserting part or querying part? 2. Can you provide the html codes you done so far for reference? 3. Can you provide the expected result? | |
Re: modify the `$sql = "SELECT ID, Title, Author, Content FROM Posts WHERE ID = '2'";` into `$sql = "SELECT ID, Title, Author, Content FROM Posts WHERE ID = '".$_GET['post']."'";` or you can assign the $_GET['post'] into a variable first before use in query like $id = $_GET['post']; $sql = "SELECT … | |
Re: review your sql statement: where what? and your echo $result wonder if it will work. | |
Re: If you are using pure php, I suggest you add a form with method="post" outside your table tag and a submit button. Then your display code can be changed from `<td><?= $row_data['last_name'] ?></td>` into `<td><input type="text" name="last_name[<?= $row_data['id'] ?>]" value="<?= $row_data['last_name'] ?>"/></td>` where I assume the id field in your … | |
Re: This error normally means that the connection is being blocked either on your server's side (outbound) or on the receiving server's side (inbound). | |
Re: Maybe what you should do is to understand the codes by yourselves and following @diafol's suggestion to cut it down to the relevant stuff. As from what I viewed, you simply copied and paste the code from your 'clients old programmer' and expect we do the job for you. Maybe … | |
Re: Normally, when we deal with wordpress, we don't navigate to the folders ourselves. If you wish for a slider, maybe you should consider the custom post type named 'sliders' by adding these code into functions.php <?php //add "slider" custom post add_action( 'init', 'create_slider_post_types' ); function create_slider_post_types() { register_post_type( 'slider', array( … | |
![]() | Re: Agreed with @diafol, If I am in the case, I will change the code to this: <th > </th> <th > <9:00 </th> <th > 9:00 - 10:00 </th> <th > 10:00 - 11:00 </th> <th > 11:00 - 12:00 </th> <th > 12:00 - 13:00 </th> <th > 13:00 - … |
Re: Agreed with @broj1 where your $topuid is probably not defined as an array. And the cause is actually can be found easily by paste the error to google. Here is what I do: `echo implode(', ', (array)$topuid);`, with this code, the $topuid will be cast into an array for implode. | |
Re: Probably is because you left out the name="submit" in your second form. Try this <?php session_start(); include_once("config.php"); ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Search</title> <link href="style/style.css" rel="stylesheet" type="text/css"> </head> <body> <br> <div id="books-wrapper"> <!-- #content to center the menu --> <div id="content"> <!-- This is the … | |
Re: First of all mysql_query and mysql_fetch_array has been depreciated. Please look into http://php.net/manual/en/function.mysql-query.php for details and replacement. What is the purpose if this line of code `$query = "SELECT * FROM `customer` WHERE `MSISDN` = '$_POST[MSISDN]'";` since you never used the result queried. How is you database structure? Is MSISDN … | |
Re: Based on your code, when user did not update the profile picture, the `input type="file" name="upload"` will be empty field where after being posted to the php, the checking on `if(!empty($filename))` will be false and do nothing but still, it will proceed to `$newupid=mysql_query("update candidate setupload='$uploaded_files' where id='$upid'")` where the … | |
Re: Maybe you can refer this: http://stackoverflow.com/questions/3860280/sql-insert-into-multiple-tables-in-one-query | |
Re: You can probably google about 'php list vs array' and get what you want and maybe you will be more understand after go throught examples in this link: http://php.net/manual/en/function.list.php | |
Re: Do you meant 'Visitor'? A customer who maybe viewing admis's post but do not have the rights to modify. ![]() | |
Re: For the second page, remove the `<option value='{$_POST['price']}'>{$_POST['price']}</option>`, then in each of the option, add an if statement to check if the $_POST['price'] is with the option value. If the value is matched, add the attribute 'selected' to that option. | |
Re: For a wordpress site, please do not add the table manually, normally what we done is use a custom post type by nested the code into functions.php //add "product" custom post add_action( 'init', 'create_product_post_types' ); function create_product_post_types() { register_post_type( 'product', array( 'labels' => array( 'name' => __( 'product' ), 'singular_name' … | |
Re: The reason you code can just get the last added items is probably because the tructure you design will only add rows with the input elements with same name and id which are 'name','email' and 'mobile' means the form only will post one name, one email and one mobile to … | |
Re: You can use regex like this: ^[0-9\-\(\)\, ]+$ Or refer this link for other methods: http://stackoverflow.com/questions/18351553/regular-expression-validation-for-indian-phone-number-and-mobile-number | |
Re: I think what you need is array sorting before your display. Try to refer http://php.net/manual/en/array.sorting.php for the function you needed | |
Re: numberVal.replace(/"/g, ''); ignore this. This is not working on array | |
Re: First of all, what is the problem that you faced? As from what I see, you don't asking any question in the thread. And, I found that you posting your 'Username' field as `$_POST['date']` where is may confused the user. On the other hand, the `$_POST['name']` will be always empty … ![]() |
The End.