370 Posted Topics
Re: There is no reason why you can't store the admin details in the main database, just make sure you hash the password and use mysql_real_escape_string for any posted data to prevent sql injection. Also ensure your database connection information is kept outside of the public site to protect it. | |
Re: Do not use session_register, it is deprecated. What do you get if you use [CODE]var_dump($_SESSION);[/CODE]? | |
Re: As ardav says it is a Unix timestamp and if you want to change it into a date format: [CODE]$date = date('Y-m-d', time());[/CODE] | |
Re: [CODE]$strQuery = "SELECT * FROM tablename WHERE column_name LIKE '%Fun%' ORDER BY name"[/CODE] If your table is called database I would highly recommend changing it's name to prevent issues. | |
Re: Remove the float: left; from your center div and set it's left and right margins to match the width of your left and right divs | |
Re: Your image tag isn't closed so will cause errors: [CODE]<a href="http://twitter.com/thirdspaceme" title="Check Out YOURthirdspace Twitter"><img src="http://i.imgur.com/qi1OJ.png" alt="YOURthirdspace" </a>[/CODE] Should be: [CODE]<a href="http://twitter.com/thirdspaceme" title="Check Out YOURthirdspace Twitter"><img src="http://i.imgur.com/qi1OJ.png" alt="YOURthirdspace" /></a>[/CODE] | |
Re: Find the query that inserts the user's data into the database and change the status_code to equal P instead of A. The code you posted is not relevant to what you are asking for help with so I can't be more specific. | |
Re: [CODE]SELECT * FROM table_name WHERE column_name LIKE 'R%' AND colum_name LIKE '%Y'[/CODE] | |
Re: [CODE].leftDiv{ float: left; margin-right: 80px; }[/CODE] | |
Re: Or use a join [CODE]$memque="select * from tblevent left join member on member.member_id=tbleevent.member where member.member_id=5)";[/CODE] This is assuming your member number in tblevent is the member id in your member table. | |
Re: All you javascript and css should be between the <head> tags (well actually they should be in external files that you link to but that is another issue). The place your php include right at the top of the page before any of the HTML. [CODE] <?php include("members.php"); ?> <!DOCTYPE … | |
Re: You query is not formatted correctley [CODE]select NAME from TAB1 left join TAB2 on TAB1.ID = TAB2.ID where TAB1.NUMBER= TAB2.NUMBER;[/CODE] Or if you are trying to join with a 3rd table [CODE]select NAME from TAB1 left join TAB2 on TAB1.ID = TAB2.ID LEFT JOIN TAB3 ON TAB3.NUMBER=TAB2.NUMBER where Put Your … | |
Re: That is an issue you need to take up with your hosting provider. | |
| |
Re: You need to learn PHP and / or Javascript depending on where you store the data you want to search | |
Re: Your path is wrong - it should be a forward slash, not a back slash as in any path to a file. [CODE]include("includes/koneksi.php");[/CODE] | |
Re: What format are the month and year in the database? | |
Re: Why are you using php.ini to set permission - you should do that using CHMOD in your file manager. | |
Re: Why is you query so complex, simplify it to: [CODE] if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) { $insertSQL = "INSERT INTO blog (title, specialization, message, email) VALUES ' " . mysql_real_escape_string($_POST['title') . " ', ' " . mysql_real_escape_string($_POST['specialization']) . " ', ' " . mysql_real_escape_string($_POST['words']) . " ', ' " … | |
Re: Quite easy, just ensure you grab the opt_out column value for each user when you view them and echo it out, something like [CODE=php]<?php if ($row['opt_out'] == 0) { echo 'Opted Out'; } ?>[/CODE] | |
Re: Use View Source on your form page to check that there is a value for the hidden id field as $_POST['id'] will work as long as there is a value to post. In fact, where are you getting the value for $id from anyway to use in your query in … | |
Re: The first thing I would do is move all your scripts out into external js files and load them into your page rather than having them inline. Then the second thing would be to place them just before the closing body tag so that your page loads before you try … | |
Re: Try these changes: [CODE] body { padding:0; margin:0; } #content { width:500px; height:600px; margin: 0 auto; color:red; background:#e3eeff; padding:10px; border:1px solid green; } [/CODE] | |
I just thought I would re-iterate something that I have mentioned a few times in my replies to threads on here in that if your code isn't working, one of the first things to do is actually test your query in the database (i.e. through phpMyAdmin). The reason I am … | |
Re: The columns in your query and the syntax error don't match - where is member_type='none' come from? | |
Re: Why not just echo out $_POST['age'] as that is all you are trying to do anyway. Otherwise, if you want to store the age in a session, you need to allocate your posted age to a session variable and to do that you need to do: [CODE=php]session_start(); $_SESSION['age'] = $_POST['age']; … | |
Re: Use margin-top with a value of 300px minus top image height, minus bottom image height | |
Re: Try setting the height of your body to the height of your background image and get rid of the background-size. Though for a set image background I personally would make a wrpper div to fit the body and put the css in their and leave the body to just have … | |
Re: What format are you expecting to get from your strtotime and what format are you using in your database for the date columns? Also you original date format should be 13/12/2011 not 12/13/2011. | |
Re: You can't have spaces in your column names, so purchaser telephone needs to be something like purchaser_telephone (at the moment you are saying select purchaser.purchaser and then have a random word telephone afterwards) | |
Re: You are missing your join functionality (not sure what where clause you want to use or which table dateposted belongs to): [CODE]$sql = "SELECT entries.*, catagories.cat FROM entries INNER JOIN catagories ON entries.cat_id = catagories.id ORDER BY entries.dateposted DESC LIMIT 1;";[/CODE] | |
Re: Are you saying you only want to display the .51 part of the string 25.51? | |
Re: You are trying to get results from an INSERT query - you also need a SELCT query after your INSERT query to load results into your mysql_fetch_array and while loop [CODE] mysql_query("INSERT INTO book_tbl (title)VALUES('".$_SESSION['title']."') "); $my_query = "SELECT title FROM book_tbl"; $result = mysql_query($my_query) or die(mysql_error()); while($row = mysql_fetch_array($result,$con)) … | |
Re: You could do it in PHP instead (also you have to FROM table in your query which is wrong) [CODE] $query=mysql_query("SELECT * FROM table"); $result=mysql_fetch_array($query); while ($row = $result=mysql_fetch_array($query)) { $datefield = date('d-m-Y', strtotime($row['datefield'])); } [/CODE] | |
Re: Please show the code in the function and where you are calling/using that function | |
Re: Could really do with seeing the rest of your code (especially what you are doing before the piece of code you have already posted). However, as a start, you don't need 2 equals signs and you have put a semi-colon in your if statement which is incorrect, so should be … | |
Re: If somene orders 1 product: [CODE]mysql_query("UPDATE Product SET Quantity=Quantity-1 WHERE Id='".$id."'");[/CODE] Replace $id with your variable name foe the product id and if someone orders more than 1 of the same product store the total number in a variable like $total and change Quantity-1 to Quantity-'".$total."' | |
Re: I can't remember which but some older versions of IE don't like PNG images and you need to use a workaround for them (I remember doing this with a couple of sites but it was a couple of years ago so can't remember how) - that may be your problem. | |
Re: Is there any script on site.php that checks if a user is logged in or logging out that could redirect back to the logout page? | |
Re: You need to store the post selection of checkboxes in an array. So you would call your checkboxes all the same name and create an array from those selected. [CODE]name="nameofcheckboxes[value_id]"[/CODE] | |
Re: You also need your post data in '' and either use {} or '".."' around them: [CODE]$upd="update news set title='".$_POST['title']."',date='".$_POST['date']."',post='".$_POST['post']."' WHERE id = '".$_POST['id']."'";[/CODE] | |
Re: I would store your information in a database - much easier to work with if you want to use the number of clicks for anything in particular. With regard to clicking on the image you would need to use either javascript with an onclick() event to count or send the … | |
Re: I see the problem in Chrome as well. Firstly can you post your css and secondly a great way of checking problems like this is to add temporary borders to your divs/classes so you can see where the overlaps are actually happening. | |
Re: Also, you should not be using an </img> closing tag - there is no such thing. It should be: [CODE]echo "<div class='images_thumb'><a href='http://pashtoaudio.com/tahir_upload/".$show_img."'><img src='/tahir_upload/".$show_img."' /></a></div>";[/CODE] | |
Re: If you want to display one row you need to either change your query to include a WHERE clause rather than selecting all of the records, or select all of the records and then use and IF statement to determine which row you want to display. Using the ID as … | |
Re: I presume your problem is that the black background is only applied to the links whereas you want some padding between your link text and the edge of the black background. If this is the case then as you are only applying your black background to the link then what … | |
Re: As cereal says, you need to actually run the query using mysql_query as follows: [CODE]$sql=mysql_query("SELECT * FROM $question WHERE question=$a"); $query=mysql_fetch_array($sql);[/CODE] ![]() | |
Re: A quick and dirty solution to show you how it can be done: [CODE] <?php $sql = mysql_query("SELECT access_id FROM user WHERE id='".$userid."' LIMIT 1"); $result = mysql_fetch_array($sql); $id = $result['access_id']; $query = mysql_query("SELECT * FROM access"); ?> <select name='access'> <?php while ($accessrow = mysql_fetch_array($query)) { ?> <option value="<?php echo … | |
Re: You need to add md5() around all your references to the password that you want to look up in the database, i.e. [CODE]$newpassword = md5(mysql_real_escape_string($_POST['newpassword']));[/CODE] | |
Re: I am reading a good book at the moment from Sitepoint [URL="http://bit.ly/tpsE7F"]PHP Master[/URL] which is all about OOP (I love the Sitepoint books and their website). |
The End.