Posts
 
Reputation
Joined
Last Seen
Ranked #254
Strength to Increase Rep
+10
Strength to Decrease Rep
-2
90% Quality Score
Upvotes Received
92
Posts with Upvotes
79
Upvoting Members
50
Downvotes Received
8
Posts with Downvotes
6
Downvoting Members
8
23 Commented Posts
6 Endorsements
Ranked #299
Ranked #174
~278.32K People Reached
Favorite Tags

370 Posted Topics

Member Avatar for vindyauwu

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

Member Avatar for VINITHAPRIYA R
0
36K
Member Avatar for Maideen

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

Member Avatar for simplypixie
0
210
Member Avatar for Poonam Jadav

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.

Member Avatar for pzuurveen
2
43K
Member Avatar for manc1976

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]

Member Avatar for Syed_2
0
3K
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
198
Member Avatar for McLaren

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)

Member Avatar for clintmannar
0
3K
Member Avatar for judah.raine

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 …

Member Avatar for Dani
0
270
Member Avatar for sql_1

Where is the value of $semesterid being set and why are you repeating the same code twice for your query and dropdown?

Member Avatar for sql_1
0
1K
Member Avatar for navneil

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?

Member Avatar for broj1
0
247
Member Avatar for mgn2683

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

Member Avatar for mildred2013
0
137
Member Avatar for isaac.iji.5

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 …

Member Avatar for isaac.iji.5
0
273
Member Avatar for jacob21

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

Member Avatar for diafol
0
262
Member Avatar for vbdotnetlover

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 …

Member Avatar for vbdotnetlover
0
138
Member Avatar for Linddha

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 …

Member Avatar for urtrivedi
0
204
Member Avatar for karen.frias0316

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

Member Avatar for karen.frias0316
0
860
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
901
Member Avatar for tqmd1
Member Avatar for Bachu
0
187
Member Avatar for WebCat999
Member Avatar for Eagle.Avik

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

Member Avatar for simplypixie
0
917
Member Avatar for chrisschristou

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; }

Member Avatar for simplypixie
0
117
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
270
Member Avatar for davy_yg

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.

Member Avatar for aaaaabeecd
0
137
Member Avatar for garyjohnson

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

Member Avatar for broj1
0
443
Member Avatar for PixelatedKarma

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

Member Avatar for PixelatedKarma
0
291
Member Avatar for johmny

Along with a load of bloated, unnecessary code - oh if only it was just used for blogs as it was intended!

Member Avatar for ACRDepos
0
129
Member Avatar for gogs85

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

Member Avatar for gogs85
0
339
Member Avatar for chrisschristou
Member Avatar for robin.aditta1

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 …

Member Avatar for simplypixie
0
685
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
333
Member Avatar for NoMansLand_MFGC

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?

Member Avatar for diafol
0
297
Member Avatar for shahai.ali

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());

Member Avatar for Daniel Claff
0
276
Member Avatar for cyla

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>'; } } ?>

Member Avatar for simplypixie
0
733
Member Avatar for JeanPhilippe

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");

Member Avatar for simplypixie
0
277
Member Avatar for joseph.lyons.754

I agree with @pritaeas but off the top of my head, use DISTINCT in your query to only retrieve one instance of the same value.

Member Avatar for Szabi Zsoldos
0
149
Member Avatar for vato116

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;

Member Avatar for simplypixie
0
206
Member Avatar for mdminternet
Member Avatar for mpc123

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

Member Avatar for mpc123
0
153
Member Avatar for magicmarkuk

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

Member Avatar for magicmarkuk
0
130
Member Avatar for davy_yg
Member Avatar for simplypixie
0
107
Member Avatar for OsaMasw

Do you want the number of columns to be set or to be determined by the width available on the screen?

Member Avatar for LastMitch
0
1K
Member Avatar for davy_yg

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 …

Member Avatar for diafol
0
161
Member Avatar for chunkbar

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

Member Avatar for simplypixie
0
131
Member Avatar for dan_code_guru

LastMitch - thank you for the Mod Rewrite Generator. I have never seen that before and will make my life so much easier - woohoo :)

Member Avatar for LastMitch
0
213
Member Avatar for Szabi Zsoldos

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 …

Member Avatar for VR4Creativity
0
104
Member Avatar for ebc3142

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 …

Member Avatar for diafol
0
7K
Member Avatar for Proglearner

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 …

Member Avatar for simplypixie
0
97
Member Avatar for earlxph8

Try adding cellpadding=0 and cellspacing=0 to your table element: <table width="100%" border="0" cellpadding="0" cellspacing="0">

Member Avatar for Biiim
0
343
Member Avatar for daniel.conlinjr.1

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

Member Avatar for daniel.conlinjr.1
0
295
Member Avatar for simplypixie

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 …

Member Avatar for simplypixie
0
141
Member Avatar for hunterious.latham

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 …

Member Avatar for GraficRegret
0
425

The End.