-
Posts
522 -
Joined
-
Last visited
Posts posted by budimir
-
-
if you posted your database structure it would be much easier.
But basicly you could do:
$sql = "SELECT * FROM table_name WHERE id='$id' ORDER BY date DESC";
So this would be the last date when the change was made for that ID. And then you could do the check to see when was last change was done and send an email.
-
You can use md5() to rename your file!
That will do the trick.
-
Yup, that's right!
But I'm deleting all the records from database where I had no activites for Last 7 days. That's how I'm keeping the database clean. Also a lot of my users are putting things in the basket through the week, so this proved to be the perfect way. At least in my case.
Again, it depeneds on the purpose!
-
Cheers guys, what would be the best way? store the items so when the user returns to the site the are still in the cart do you think?
cheers
Graham
Maybe that would be the best way. But it depends on what are your needs. I have developed an e-commerce where I'm leaving everything in the basket until checkout, so user has some time to think through if that is the complete order and when he want's to send it.
-
And where is your move_uploaded_file in the script?????
You are not uploading file for now!
-
OK,
It looks good for now, but I would recomend to put PREVIOUS so you could go back.
-
Try to change this:
$site['url'] = 'http://www.mesquitechristmas.com/local/display.php?id=$id';
To this:
$site['url'] = 'http://www.mesquitechristmas.com/local/display.php?id='$id'';
-
Hosting service!
By the question you are asking here, I would say you don't have a clue what are talking about. If you don't which software to use to run a server, how the hell are you going to protect the data from the sites you're going to host?
Think it through!
-
You could use limit option in your query.
But the thing you are asking for is pagination! So try to lookup at google, or through the forums. There was a lot of discussions about it.
-
Try this
$query = "SELECT * FROM nxg_member WHERE username='$_GET['username']'";
-
I think the problem is with your php.ini settings.
Try setting max_execution_time = 1 000 000 000
max_input_time = 6 000 000 000
memory_limit = 800 M
I had the same problem and this solved it. Try it out. And you must restart Apache after making these changes, otherwise it doesn't matter.
Good luck
-
Do it like this
1. Create a form (method post) call a file like continue.php
2. Put two checkboxes
3. Put one submit button
4. One checkbox can be called I agree and value="I Agree"
5. Second checkbox can be called No and value="No"
6. Put some code in continue.php like:
if ($checked == I agree){ header("Location:somepage.php"); } else { header ("Location: #"); }
The code is not completly done for you. Try to play a little bit. I gave a hint how to do it.
-
Did you use any code for redirecting? If yes, post it, so we can take a look!
-
$sql = "SELECT * FROM comments WHERE id = '$id'"; $query = mysql_query($sql); $num_rows = mysql_num_ros($query); [color=red][font=Verdana]//Here is numrows now, but you didn't have it before, so I don't see how are you getting an error from this file when you are not using mysql_num_rows. You are probably getting error message from another file[/font][/color] $site['url'] = 'http://mesquitechristmas.com/local/display.php?id=$id'; $PageNav = swPagination( $Sql, $MRPP = $limit, $UriAdd = $site['url'], $SortByAllow = FALSE, $SortOrderSeed = FALSE ); $result = $PageNav['RowList']; #Don't think you need the stuff above IF ( !$PageNav['TotalRes'] ) echo("Nothing to Display!"); $i = 0; while ($row = mysql_fetch_array ($result)) { $color = ($i%2== 0 || $i == 0)?'#DDDDDD':'#EEEEEE'; $id[$i] = $row["id"]; $firstname[$i] = $row["firstname"]; $location[$i] = $row["location"]; $comment_date[$i] = $row["comment_date"]; $comment[$i] = $row["comment"]; print"<tr bgcolor='".$color."'> <td align='left' width='120'><strong> Name</strong>: $firstname[$i]</td> <td align='left' width='120'><strong> Location</strong>: $location[$i]</td> <td align='left' width='216'><strong> Date</strong>: $comment_date[$i]</td> </tr> <tr bgcolor='".$color."'> <td class='commentBorder' colspan='4'><strong> Comment</strong>: $comment[$i]</td> </tr>"; ++$i; } } } ECHO $PageNav['HrefNav']; } // end code for displaying comments
Can you send me both of this files on my mail? So I can check them out. We are obivously missing something out!
-
I think you are having problem with your query
$sql = "SELECT * FROM comments WHERE id = $id;";
Do it like this
$sql = "SELECT * FROM comments WHERE id = '$id'";
You have an extra ; in your query and put your $id variable in '$id '
Let us know if that was the problem!
-
Thanks, nafetski, for your response. I appreciate your time.
Let me clarify, again. I know how to echo information into a table. I can echo one field in one <td>, I can echo two fields in two <td>s. What I want to do is echo one field and have the output split into two <td>s. I dont want one looooong column, I want two columns, that are evenly distributed with clients' names.
I have a db table that has multiple fields BUT I want to list ONLY the clients' names (a SINGLE field in my table) and I would like to echo it so it shows up in two tables on the web page.
List all the clients (ONLY), in two columns on the webpage.
Does that clarify what I'm asking?
Hey superdude,
Try this peace of code, it will in 2 columns:
echo "<table cellspacing=7 border=0 cellpadding=3><tr valign=bottom>"; $i=1; while ($row = mysql_fetch_array($rezultat)){ echo "<td align=center width='25%' valign=top>"; if ($row["imgdata"]) echo "<a href='images/".$row["imgdata"]."'><img border=0 src='images/".$row["imgdata"]."' alt='".$row["title"]."' witdh='100' height='100'><br><div style='font-size:1px; margin-top:4px;'> </div><a href='images/".$row["imgdata"]."'>"; echo $row["title"]; echo "</td>"; if ($i%2==0) echo "</tr><tr><td> </td></tr><tr valign=bottom>"; // If you put instead 2 number 4 you will get 4 columns $i++; } echo "</tr></table>";
Let me know if that is what you wanted!
-
You can use \n
-
Did you try to test your mail() function and check if it's working? It needs to be setup!
-
Try to check in your php.ini file the max_exec_time
Change the value to 10000 or something like that. After that restart apache and try again!
-
When you are using header you can not send an output to the browser because you will get the error which you are getting.
So you can't use echo or print. Neither you can send html output. It need's to be clean PHP code, without output and on the end header.
-
$name_variable = (isset($_POST['checkbox_name']) ? 1 : 0);
Try using VARCHAR in SQL not BOOL, it's much simplier. Maybe bool is causing all of your problems!
-
Hey Daniel,
I agree with you about WYSIWYG, but for a newbie is the easiest way to do some things.
-
You'r problem is actually pretty simple. To help you out, you just need to post you SQL QUERY. There is your problem, so that would be something like:
$sql = "SELECT * FROM table";
Give us the code, and we will help you out. You don't need to get nervous.
-
OK, so it seems that you need to dig deeper.
Try using error reporting like:
$result = mysql_query($sql) or die(mysql_error());
And see the error message you get!
[SOLVED] ODBC
in PHP Coding Help
Posted
Hey ther,
Actually using ODBC driver is very easy. First of all, you need to select odbc driver and create an odbc connection. You go to Control Panel, click on Administration tools, then click on Data Sources (ODBC). When the window opens up, click on a tab called System DSN. Click on ADD, select Driver to MS Access. When the second window opens up put a name in "Data source name" (this is the name which you will use for calling the connection for the ODBC driver), click on SELECT and choose where your Access database resides. After that click on OK and you are set to go.
Now, create a PHP script and put in a connection line like this:
And after this, you handle it like normal PHP + MySQL code. Of course the code is a little bit diferent, but there is a lot information about this on the web.
Here is a sample of query:
I hope you got an idea. How to work with it. This is very basic.