im doing this query on mysql, but its giving me duplicate results sets:
this is my query:
SELECT u.username, u.picture, m.id, m.user_note, m.reply_id, m.reply_name, m.dt, m.votes_up
FROM user u, notes m
WHERE m.topic_id =14
ORDER BY m.dt DESC
i dont understand why its doing it? please help :))
EDIT: table schema
notes{id, user_id, ...
I'm trying to delete a file on the server. Below is the code I use.
function ServerDel($file){
$file = realpath($file);
echo ($file);
$fh = fopen($file, 'w') or die("can't open file");
fclose($fh);
if(unlink($file))
echo"Delete the file successfully.";
else
echo "Fa...
Hi Guys, thank you all so very much for helping. It's seemingly such an easy task, and I feel I just hit a brick wall and not knowing how to fix it.
I'll try to explain what I am doing a bit more and hope it makes sense.
I used a database to populate my dropdown box, dropdown box is something like:
echo "<form action='process_form.php...
I have a PHP app and I need to delete a client-side file. How can I achieve that?
I'm new to PHP. Hope someone can help me.
Thanks.
...
You see I have a set of entries to be ordered alphabetically. Though some of the entries starts with "The". What I want is to ignore "The" and start sorting from the next word. For example:
$titles->order_by("name", "ASC")->find_all() // Sample query
Abraham
Panorama
The Malevolent
What I want:
Abraham
The Malevolent // Ignore "t...
Thank you guys so much for being so helpful. Owe you guys a big thank you. I will be asking more questions in the future. Some one has solved the problem by giving me this code:
echo "" . strval($row['style']) . "" . "";
and it worked beautifully!!!!!!!!! You guys rock!
I am sorry guys, I don't know how to post follow up questions, s...
Note: Although I use a zipcode database with Dutch zipcodes, this question is country independent.
I have a database with every zipcode in the Netherlands + its x and y coordinate (lat/long).
I have for example zipcode: $baseZipCode = 1044; with the following coordinates:
x coordinate = 4,808855
y coordinate = 52,406332
Now, I want ...
hi there
i am building an edit account form, where the user can update or edit his/her account setting
such as: username, password, and email
check the submitted email and compare it to the database
1st condition: if this email is the same with the previous one
leave it be
2nd condition: but if this email is different that the previ...
Hi everyone
I am trying to setup a “view shopping cart/basket” page within a site in which logged in users earn points/credits. Once they earn a certain amount of these points they can then go to a shopping cart and pay with these points only. (No money changes hands, so no paypal/checkout/shipping/taxes etc are involved)
So far I hav...
Hi All,
We have started using Hudson, and the current workflow is:
checkout locally > code > run tests > update > run tests > commit
Rather that polling, Hudson simply sits there until we instantiate a build. It then:
checkout locally > run Phing script
The Phing script then:
svn export latest revision > run tests (if successful) ...
I have an access denied page, which should not be shown in menus. However, it's possible for the user to be redirected to the access denied page.
I also have a breadcrumbs section on the page, and if you go to the access denied page, it shows as blank, which is extremely ugly.
I would therefore like to register the page, but not have t...
i was wondering if you can have conditional statments inside a heredocs, this is my script but it deosnt parse out the $username properly?
php code:
function doSomething($username) {
if (isset($_SESSION['u_name'])){
$reply ='<a class ="reply" href="viewtopic.php?replyto=@$username.&status_id=$id&reply_name=$username"> reply </a>';
re...
I would like to fold {} brackets i.e if/else, for, while, foreach... sections in eclipse pdt. How can i do it. I don't see any options in settings.
...
Hello,
I am trying to set status msgs for users from my application. While doing that I get the following exception for random users in my list.
PHP Fatal error: Uncaught exception 'FacebookRestClientException' with message 'An unknown error occurred' in /public/facebookapi_php5_restlib.php:3065
Stack trace:
#0 /public/facebookapi_p...
<?php
function check($user_id, $topic_id){
$query = mysql_query("SELECT user_id, topic_id FROM sa where topic_id='$topic_id' and user_id='$user_id'");
if (mysql_num_rows($query)==1){
return 'you have already voted';
}
else {
$against = ' <li>
<button type="submit" value=...
How do I put a period into a PHP regular expression?
The way it is used in the code is:
echo(preg_match("/\$\d{1,}\./", '$645.', $matches));
But apparently the period in that $645. doesn't get recognized. Requesting tips on how to make this work.
...
Welcome,
Does someone have any resources about creating large zip files (one file, not folder) in PHP ?
Without using shell access to "zip" application.
low memory usage (i can't use gzcompress) because file is to large to do this in RAM.
I have unzip function work perfect on low memory system
Here is unzip,.
http://paste-it.net/p...
I have a simple table:
<table cellpadding="0" cellspacing="0" style="width:600px">
<tr>
<td style="width:100px; padding:5px; border:1px solid #444">E-mail</td>
<td style="width:500px; padding:5px; border:1px solid #444">[email protected]</td>
</tr>
<tr>
<td style="width:100px; padding:5px; border:1px solid #444">Message</td>
...
I know this is not programming related question so to speak, but since we are programmers and we might use Netbeans for PHP development.
I am wondering how can I get in Netbeans to update the comment block in front of a method, after I change the parameter set. I need to update it someway automatically, and to keep what I've been added ...
I have a function that fires when the scroll bar hits the bottom. For some reason now, IE is firing the event twice. It wasn't doing it before. I don't have a duplicate function, and not have the JS declared twice. It's fine in Opera, FF, Chrome. I don't know why it's doing so in IE. Oh how I hate M$ and this troublesome browser.
jQuer...