370 Posted Topics
Re: Your queries are wrong - you should be using **=** NOT **LIKE** when selecting by matching id (or any other data). LIKE is for finding similar data. With regard to selecting one message for each batch of messages: $query = mysql_query("SELECT * FROM `private_messages` WHERE to_id='$ID' AND To_Deleted=0 ORDER BY … | |
Re: For each value that you want to check: $errors = 0; $error_msg = ''; if (!isset($_POST['fname']) || empty ($_POST['fname']))) { $errors++: $error_msg = 'Errors Text'; } // And so on for each posted field you want to check and then echo out the errors in the page if ($errors ==0) … | |
Re: Your centre image needs a left and right margin and your right div needs to come before your center div in the html. Have you checked all your widths and padding aren't totalling to wider than the containing div? | |
Re: It is fairly simple. * Check the form has been posted * Check the content isn't empty * Display/echo the comment And here is the code to do it: <?php if(isset($_POST['content'] && !empty($_POST['content'])) { echo $_POST['content']; } ?> Put this code within the page where you want the comment to … | |
I am using jQuery and Ajax to add items to a shopping cart and in all areas of the site apart from one it works fine and I cannot for the life of me work out why this one area isn't working. The form code (which is the same as … | |
Re: You need to check if the posted data has a value and if so if it equals the value in the menu then if it does, mark as selected: <option value="<?php echo $row_rs_condo['condo_name']?>" <?php if (!empty($_POST['condo_nm']) && $_POST['condo_nm'] == $row_rs_condo['condo_name']) { echo 'selected'; } ?>><?php echo $row_rs_condo['condo_name']?></option> | |
Re: It is not ajax you need to do what you are looking for it is plain JavaScript or jQuery. In it's most basic form just use an alert | |
Re: Where is the code getting the 'voted' from the database and storing it in the session? | |
I used to be able to select which forums I received through my RSS feed and since the changes to the site my RSS feed stopped working so I hvae re-subscribed but it appears that I now have to receive all new posts from all forums meaning I am getting … | |
I am using jQuery and Ajax for some areas of a site and I cannot for the life of me work out how to only submit the Ajax if the form is valid. For normal jQuery validation I am using jquery.validate.min.js like this: $("#po-login-form").validate(); This works fine. I then have … | |
Re: It basically means that your login details are incorrect for the database. | |
I hope the title means something, I don't really know how to explain what I am trying to do in a few words. I think better with an example. I have a click event to display an enquiry form on a contact page: [CODE]$("#enquiry-form").hide(); $('.enquiry-form').click(function() { $(this).hide(); $('#enquiry-form').fadeIn( 'slow', function() … | |
Re: What type is the field in your database? | |
Can anyone see why my variable $unit_price isn't updating (in fact it isn't even being applied to the session variable) in this code (it must be something simple but I can't see it and is driving me mad). I have tested the posted data and it is being sent through … | |
Re: Have you unticked the box in the Settings->discussion to not allow comments (Allow people to post comments on new articles )? | |
Re: Surely the first thing you need to do is set your session to keep the user logged in and then you would just use an if statement to check is logged in before showing the other forms: [CODE]<?php session_start(); extract($_POST); $uname=$_POST['user']; $pwd=$_POST['password']; $con=mysql_connect('localhost','root','') or die('could not connect:'.mysql_error()); mysql_select_db("priya",$con); $result=mysql_query("select * … | |
Re: It looks like you are trying to put a space between the 2 variables so you need to use quote marks: [CODE]$body = $name.' '.$number[/CODE] | |
Re: You won't get anything as their is no such variable as $row['name']. You need to add the $a variable to the end of your link url (why are you using the name parameter in the link??): [CODE]echo "<a href='viewlink.php?name=".$row['name']."'>". $row['name'] ."</a>". " | " ;[/CODE] And on your receiving page: … | |
Re: You can't get it from your login page - you need to retrieve it from the database once they have logged in correctly. Everything in your code is relying on the user inputting their year of birth in the login form and posting it through. | |
Re: In the value of each form field you need to echo the posted data, for example [CODE]<input type="text" name="username" value="<?php if (isset($_POST['username'])) { echo $_POST['username']; } ?>">[/CODE] | |
I am new to Ajax and have only been learning jQuery on and off for a few months so I apologise if this should be simple. I have followed a tutorial to get shopping cart functionality working using PHP, jQuery and Ajax and it is nearly there but I have … | |
Re: You have an incorrect $ in your update query and no quote marks around your variable [CODE]$ser_no=$sernum[/CODE] Coorect: [CODE]$sql2="UPDATE $tbl_name SET status='Completed' WHERE ser_no='".$sernum."'";[/CODE] | |
Re: [CODE]SELECT * FROM name WHERE task_my_id NOT IN (SELECT task_my_id FROM subname)[/CODE] | |
Re: I am not saying that this is what is causing the problem (though it may be) but you have 2 id's named the same (you can only use one id per page, otherwise it needs to be a class): [CODE]<div id="navdiv"> <!--about us submenu list ends--> <ul id="navdiv">[/CODE] | |
Re: Before you even look at getting the query results as @ardav has mentioned, your query will fail anyway as your form variables are wrong to work with what you are trying to do (you have put the method as get then tried to get the value using post - also … | |
Re: Use CSS - for example set the table rows to white with black text and change the odd rows to a balck background with white text (modify to your needs, desired colours) [CODE] tbody tr { background: white; color: black; tbody tr:nth-of-type(odd), .odd { background: black; color: white; }[/CODE] This … | |
Re: This might help you work out what you need to do [CODE]if (!is_array($_SESSION['basket'])) { $_SESSION['basket']=array(); } if (is_array($_POST['qty'])) { foreach ($_POST['qty'] as $key=>$quantity) { $quantity=ceil($quantity); if ($quantity==0) { unset($_SESSION['basket'][$key]); } else { $_SESSION['basket'][$key]['qty']=$quantity; } } }[/CODE] | |
Re: Can you clarify - are you trying to calculate the total weight of multiples of the same item or the total weight of multiple items? ![]() | |
Re: You simply need [CODE]Select customerNumber From Table1 Where customerNumber NOT IN (select customerNumber from table2)[/CODE] You don't need to join or select from 2 tables in the main part of your query | |
Re: Your problem is here [CODE]$rows=mysql_fetch_array($sql3);[/CODE] This should be [CODE]$rows=mysql_fetch_array($result3);[/CODE] | |
I always develop sites using CSS but am aware that tables have their place when displaying tabular data, however I can't decide whether to use CSS or a table to display the products on the home page of a re-design I am doing and just want peoples opinions please (note … | |
Re: Have you checked that you are getting any results from the actual query or tested that the query is working in any way (you can try echoing it as a start)? Your echo of paid_thru should just be [CODE]echo $row['paid_thru'];[/CODE] | |
Re: These conditionals don't make sense [CODE]if($s_veration == $remnder_ver) { echo" <strong>Specific Variation</strong> ought to have a value equal to <strong>Reminder Variation</strong>, please go back and alter your values"; exit(); } elseif($s_veration >= $remnder_ver) { echo" <strong>Specific Variation</strong> ought to have a value grater than <strong>Reminder Variation</strong>, please go back and … | |
Sorry if the title of this thread doesn't make sense - I didn't know what to write :) I am using jQuery form validation and one of the rules is to check for a valid url. The field isn't required so am just validating formatting. This all works fine but … | |
Re: To prevent the gap, remove cellspacing from the table (or set it to 0). | |
Re: There are no leading zeros in auto-incremented ids so you will only ever get MATH 20121 as your code is. If you want to include a zero you will have to put it in [CODE]$b="MATH"."$yr".0."$id";[/CODE] ![]() | |
I am not sure if this is a server issue as seemed to be working on my testing server but now live on the clients server this issue is arising. The email is generated from a form which includes a file upload in either word or pdf which is saved … | |
Re: Your query is incorrect - you cannot have spaces in column names so you need to change the column names in your query to what they actually are in your database, either as all one word or with an underscore between. For example employee_no or employeeno (as I say it … | |
Re: Because to display 2 columns next to each other and independent of each other you need to float at least one of them. For example [CODE]#faq1 { float: left; margin: 0 0 0 10px; width: 250px; } #faq2 { margin: -200px 0 0 300px; width: 250px; }[/CODE] | |
![]() | Re: A few things - firstly you have out your die on the next line, php needs to be on one line, secondly you are running your mysql_query twice and thirdly you are trying to run two queries in your while loop. This should work (unless there are other problems): [CODE]include … ![]() |
I have finally got around to utilising jQuery form validation on a new site I am doing the coding for and even though everything is working exactly as it should I need to move one of the error messages to display below rather than to the right as the other … | |
Re: phpMyAdmin is just an admin area for MySQL to make working with your database easier and more intuitive so don't get confused that it has anything to do with your website or coding. It is the PHP that will determine how much of your text is displayed so you need … | |
Re: The most basic method would be to attach their email address to the unsubscribe url and then use $_GET at the unsubscribe page to update your database and then just display a page to them to say the have unsubscribe. Briefly: [CODE]<a href="http://www.domain.com/alert_unsubcribe.php?email={$tt}">Unsubscribe</a>[/CODE] Then at the unsubscribe page: [CODE]if (isset($_GET['email']) … ![]() | |
Re: Undefined index is just a warning, not an error and it is just advising to check if the variable exists or has a value so all you have to do is out an if statement in your code and in your case around the whole php by the look of … |
The End.