- Strength to Increase Rep
- +10
- Strength to Decrease Rep
- -2
- Upvotes Received
- 92
- Posts with Upvotes
- 79
- Upvoting Members
- 50
- Downvotes Received
- 8
- Posts with Downvotes
- 6
- Downvoting Members
- 8
Re: You aren't getting the data from your query. mysql_num_rows returns exactly what it says, the number of rows returned from a query - therefore it cannot be equal to a strings, only an integer. Change to: $query = mysql_fetch_array($login); // Check username and password match if ($query['user'] == 'admin') { … | |
Re: I am consfused as you say you want to update table 2 from table 1 but your query that isn't working is updating table 1 from table 1. Please clarify which table it is you need to update | |
Re: On the receiving page you need to use[CODE]$id = $_GET['id'];[/CODE] not $_POST as you are not posting the data (you would be if using a form to pass the data) you are sending in a URL and therefore need to use $_GET. | |
Re: Simply like this: [CODE]<?php $query="SELECT location,id FROM area"; $result = mysql_query ($query); echo '<select name="location_id">'; echo '<option value="">Please Select..</option>'; while($nt=mysql_fetch_array($result)){ echo '<option value="'.$nt['id'].'">'.$nt['location'].'</option>'; } echo '</select>'; ?>[/CODE] | |
Please look at my jsfiddle here - http://jsfiddle.net/ftuZ5/ . I know why the links won't work as the relative positioning I have used to create the link / menu backgrounds I want is covering the a element but I can't work out how to resolve the issue (having tried relative … | |
Re: If each of your right and left floats have set widths, then add the appropriate margins to the center div (i.e. if both floats are 200px wide then set the left and right margins on your center div to 200px each) | |
Re: In lines 229 and 235 you have forgotten the `<?php endif; ?>` (added below) <div id="excerpt"> <div> <p><span id="label"><b>Excerpt:</b></span> <div style="float:left;"> <div><?php if(!empty($item->fields_by_id[32])):?><?php echo $item->fields_by_id[32]->result; ?><?php endif; ?></div> </div> </div> </div> <div id="memreview"> <div><?php if(!empty($item->fields_by_id[14])):?><?php echo $item->fields_by_id[14]->result; ?><?php endif; ?></div> </div> I have also noticed that you have some extra … | |
Re: Where is the value of $semesterid being set and why are you repeating the same code twice for your query and dropdown? | |
Re: Well you will do as you are selecting all records and echoing them out through one loop all in the same unordered list. What exactly are you trying to do? | |
Re: It is your container div causing the problem and it is not required - remove it and the extra space will disappear. This then leaves the problem that if the content is too little the fotter will have a gap underneath it but that can be fixed by using position: … | |
Re: Well it is difficult to answer properly without seeing what you have done so far but I would have a friends table that will hold the ids of users with related ids of their friends and then you can just cross reference that table to match friend ids with user … | |
Re: Are you sure `$_REQUEST['newstype']` actually has a value? Is the text of your echo being displayed? How are you sending through 'newstype' (post or get)? | |
Re: The code in your page <?php if (isset($_POST['button1'])){ $name=$_POST['text1']; }else{ $name=""; } if ($name) { echo 'My name is ' . $name; }else{ echo 'No name entered'; } ?> is different to the code that you have posted below and incorrect to only run the echo if the form has … | |
Re: You can use += which will add onto each previosu total through a loop $koinp=mysql_num_rows($coinp); $total = 0; // Put this is to define the variable and set the initial amount to 0 while($oinp=mysql_fetch_array($coinp)){ $comme=mysql_num_rows($comentar); // echo" ($comme) </br>"; $total += $comme; // Add each value of $comme to the … | |
Re: Just wrap your code in an if statement and if there is a file it will run the image processing, otherwise it will just ignore it (then load your default image on the front end) if (!empty($_FILES)) { } In fact this should replace your current if statement | |
I am using tinymce on a cms and I want to be able to have a dropdown menu of all pages on the site (stored in a db) to choose from when adding a link but all I am getting is an emtpy set of values. I am using the … | |
Re: You would need to use a combination of jQuery, Ajax and PHP | |
Re: Are you looking to create 3 columns in each section? | |
Re: So what problem do you have now (you don't say)? Also you don't need to declare an array of variables in your execute statement unless you are using placeholders, just use execute() | |
Re: Set all images to 100% width with a max-width specific to images in specific divs to make sure they don't get bigger than the orginal img { width: 100%; height: auto; } | |
This is driving me insane - I have certain links that are re-written on a site that work perfectly fine (and I am not new to re-wring urls) but have just found that some others aren't and I cannot fathom out why. What works: // The link <a href="/shop/<?php echo … | |
Re: As drjohn says, just [CODE]text-align:center;[/CODE] on your containing banner div that you already have in place and remove all css for the images as it won't then be required unless you want to add margins or padding around them. | |
Re: I would re-structure to just query on the user and then compare the returned ids to your array of ids $secondArray = array(); //$ids = join(',', $IdArray); $query = "SELECT * FROM test WHERE user = '$user'"; $results = mysql_query($query); while($row = mysql_fetch_array($results)){ if (in_array($row['id'], $IdArray)) { $secondArray[] = "YES"; … | |
Re: Passing as an array is exactly what you should be doing. Not sure whee you have heard that passing form data as an array is wrong as that is the only way to pass the data if you have multiple fields of the same 'type'. | |
Re: Along with a load of bloated, unnecessary code - oh if only it was just used for blogs as it was intended! | |
Re: You shouldn't be using session_register as it is a depricated function. Just assign your session vaiables like $_SESSION['email'] = $email; $_SESSION['login_pass'] = $login_pass; And then check the session is there as @phorce said by using if(!isset($_SESSION['email'])) { } However there are also two other points I would like to make: … | |
Re: What is on line 94? | |
Re: You are looking at the wrong query - the error message states you have an error near 'ORDER BY m_date DESC' in your original post and then the next error is near 'ORDER BY percent DESC' in a later reply but the query you have posted has no ORDER BY … | |
As usual I am having a love hate relationship with jQuery and Ajax :) I have a PHP file that uploads and resizes and image and stores the data in the database, which on its own works fine. I am now trying to do this through a jquery modal/dialog box … | |
Re: This all looks unnecesarily complicated (plus you don't show your db queries so we can see where the problem may be occuring) - have you looked at using PHP's [DateTime](http://php.net/manual/en/book.datetime.php) class / functions? |