334 Posted Topics

Member Avatar for phoenix254

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 …

Member Avatar for phoenix254
0
121
Member Avatar for Niloofar24

`<?php the_content( $more_link_text , $strip_teaser ); ?>` is for wordpress usage.

Member Avatar for Niloofar24
0
530
Member Avatar for afaaro

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 …

Member Avatar for afaaro
0
359
Member Avatar for ramsiva

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.

Member Avatar for ramsiva
0
187
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
410
Member Avatar for SoMa_2

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 …

Member Avatar for lps
0
10K
Member Avatar for jay.barnes

Try changing `$this->results = $this->execute->affected_rows;` into `$this->results = $this->connection->affected_rows;`

Member Avatar for jay.barnes
0
353
Member Avatar for lps

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 …

Member Avatar for lps
0
305
Member Avatar for lps

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 …

Member Avatar for lps
0
305
Member Avatar for SoMa_2

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.

Member Avatar for lps
0
375
Member Avatar for evandrosiqueira

http://www.percona.com/blog/2013/09/11/how-to-move-the-innodb-log-sequence-number-lsn-forward/

Member Avatar for diafol
0
1K
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
400
Member Avatar for Niloofar24

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.

Member Avatar for Niloofar24
0
878
Member Avatar for d_randhawa
Member Avatar for d_randhawa
0
2K
Member Avatar for riwakawd

Change your codings for `if ($categories)` into `if (isset($categories) && !empty($categories))` Then `if ($category['children'])` using same feature and try again.

Member Avatar for riwakawd
0
184
Member Avatar for ramsiva

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 …

Member Avatar for ramsiva
0
247
Member Avatar for vivosmith

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: " …

Member Avatar for vivosmith
0
351
Member Avatar for jj.dcruz

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 …

Member Avatar for lps
0
345
Member Avatar for UK-1991

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 …

Member Avatar for lps
0
108
Member Avatar for Niloofar24

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 …

Member Avatar for lps
0
985
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
1
1K
Member Avatar for UK-1991

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 …

Member Avatar for UK-1991
0
271
Member Avatar for Niloofar24

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'] . "'>" …

Member Avatar for DJBirdi
0
307
Member Avatar for rhodoscoder

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.

Member Avatar for rhodoscoder
0
205
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
518
Member Avatar for Manoj_16

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 …

Member Avatar for lps
0
3K
Member Avatar for dennishall

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.

Member Avatar for lps
0
258
Member Avatar for punji

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?

Member Avatar for lps
0
328
Member Avatar for Niloofar24

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 …

Member Avatar for Niloofar24
0
2K
Member Avatar for Niloofar24
Member Avatar for Niloofar24
0
312
Member Avatar for jj.dcruz

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 …

Member Avatar for jj.dcruz
0
313
Member Avatar for digital-ether

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).

Member Avatar for lps
0
4K
Member Avatar for KateyB

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 …

Member Avatar for lps
0
251
Member Avatar for Catalin_1

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( …

Member Avatar for lps
0
183
Member Avatar for Stephen_9
Member Avatar for anmol.raghuvanshi1

Agreed with @diafol, If I am in the case, I will change the code to this: <th >&nbsp;</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 - …

Member Avatar for lps
0
246
Member Avatar for janicemurby

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.

Member Avatar for janicemurby
0
361
Member Avatar for spud91

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 …

Member Avatar for jj.dcruz
0
266
Member Avatar for Makara

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 …

Member Avatar for Makara
0
3K
Member Avatar for AntonyRayan

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 …

Member Avatar for alisajjad160
0
193
Member Avatar for habib rahman

Maybe you can refer this: http://stackoverflow.com/questions/3860280/sql-insert-into-multiple-tables-in-one-query

Member Avatar for lps
-2
94
Member Avatar for Violet_82

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

Member Avatar for DaveAmour
0
190
Member Avatar for Themby

Do you meant 'Visitor'? A customer who maybe viewing admis's post but do not have the rights to modify.

Member Avatar for diafol
0
104
Member Avatar for uchejava

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.

Member Avatar for Szabi Zsoldos
0
275
Member Avatar for amith_ami

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' …

Member Avatar for lps
0
298
Member Avatar for ramsiva

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 …

Member Avatar for ramsiva
0
138
Member Avatar for AntonyRayan

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

Member Avatar for lps
0
89
Member Avatar for riwakawd

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

Member Avatar for Kyle Wiering
-1
526
Member Avatar for mbarandao
Member Avatar for mbarandao
0
511
Member Avatar for UK-1991

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 …

Member Avatar for diafol
0
6K

The End.