- 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
370 Posted Topics
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? ![]() | |
Re: Try this correction to your code (not sure what the NULL is for in your query and so have removed, I have also guessed at the field name in your table): $fileName = $_FILES["f_name"]["name"]; $path = "uploads/" . $filename; } mysql_query("INSERT INTO mytable file_path VALUES ('".$path."')") or die(mysql_error()); | |
Re: You can actually do this in your query instead of PHP <?php $dtwarning = mysqli_prepare($db,"SELECT DATEDIFF(tarikh_tamat, NOW()) AS date_diff FROM spoc_pma2012 ORDER BY bil"); $dtwarning->execute(); $results = $dtwarning->fetch_all(); foreach ($results as $row) { if ($row['date_diff'] <= 7) { echo '<div class="error"> <p>Warning</p> </div>'; } } ?> | |
Re: As @shahidpk has said, use a join but they have missed the search on the animlas table $query=mysql_query("SELECT c.*, a.* FROM customers c INNER JOIN animals a WHERE c.name LIKE '".%$search%."' OR a.name LIKE '".%$search%."' ORDER BY c.name ASC"); | |
Re: You are missing ending semi-colons on some of your lines and also not closing your " on your echos $p = $h * $r; echo "Your Weekly Salary Is: ".$p; $p = ($h * $r) + (($h - 40) * $r * 1.5); echo "Your Weekly Salary Is: ".$p; | |
| |
Re: Do what urtrivedi has advised and remove all your html and javascript from the php and see if your problem is resolved while($row = mysql_fetch_array($result)){ ?> <div class="BoxContainer"> <div class="contentBox"> <span class="inBoxTitle green">A box</span> <!-- Demo Button! --> <button class="botGreen" id="botSmallPic1">Picture 1</button> </div> </div> <!-- .BoxContainer --> <script type="text/javascript"> // … | |
Re: In answer to your first question, just add or statements to your if stament if ( strpos($matches[2][$k], 'http://mysite.com') === false || strpos($matches[2][$k], 'http://localhost') === false) If I understand your second question correctly $multiLinks = array(); $localhost = 'Assign 1 or 0 here' foreach ( $matches[0] as $k => $match ) … | |
| |
Re: Do you want the number of columns to be set or to be determined by the width available on the screen? ![]() | |
Re: It depends on the format of your date that is being posted (echo out the posted date and check). If it is in any other format other than yyyy-mm-dd then the database won't recognise it and will leave as 0000-00-00. If it is in a different format then you need … ![]() | |
Re: You are not using the data returned from your query correctly, please note that any results returned are always in an array, therefore your if else statements should be: if($omgg['type'] == "Deluxe Floor Room"){$rrate=350;} Or you can assign the returned result to a variable first: $type = $omgg['type']; if($type == … | |
Re: LastMitch - thank you for the Mod Rewrite Generator. I have never seen that before and will make my life so much easier - woohoo :) ![]() | |
Re: If you are mixing AND and OR in your queries you need to group them into parenthesis SELECT * FROM contact WHERE status = '1' AND lower(concat(nume,' ',prenume)) LIKE '%test%' AND (lower(concat(prenume,' ',nume)) LIKE '%test%' OR functie LIKE '%test%' OR email LIKE '%test%' OR compartiment LIKE '%test%' OR email LIKE … | |
Re: There are a couple of errors in your code ( to execute you need to prepare first and your execute should be $stmt->execute(), not $stmt = $pdo->execute()) I actually find using foreach with PDO tends to work better for some reason. I would also agree with diafol that you should … ![]() | |
Re: 1. I have to disagree with zoidmaster - do not use relative or absolute positioning and z-index unless absolutely necessary, there are easier and less buggy ways to position the content in your pages. 2. If you are going to use % or ems (but ems is better for font … | |
Re: Try adding cellpadding=0 and cellspacing=0 to your table element: <table width="100%" border="0" cellpadding="0" cellspacing="0"> | |
Re: 'On a non-object' means that you haven't instantiated a class and therefore no object has been created. Looking at your code though the function you are trying to use is just a function, it is not within a class and therefore you cannot use -> to access the function (that … | |
My brain won't work (in fact it doesn't often when it comes to comparing dates). I need to check whether a date returned from the database is 7 days or less from the current date (can't do it in database as it is used to highlight events where entries close … | |
Re: This is all pointing to an error in your query which I would say is the fact that you are trying to select all from table c but you don't define table c and your are not joining to to. Firstly try removing `c.*` from your query and see if … |
The End.