370 Posted Topics
Re: You have this for($i=0;$i<$count;$i++){ But don't seem to have set a value for `$count` anywhere so the is no value to compare `$i` to. | |
Re: You need to order the results in your query: $sql = "SELECT Title, Date, Place, Description FROM Events ORDER BY Date ASC"; Either ASC or DESC depending which order you want them in | |
Re: Once you have done whatever it is you need to do with your posted data (that part of your code isn't shown and you currently have to action specified in your form), just add your values to the url: header('location: your_page.php?post_id={$_POST['post_id}&album_id={$_POST['album_id']}'); | |
Re: What you are currently doing is trying to find records where year = '2012, 2011, 201, 2009, 2008' and I would think that you don't have a value like that in your database. I presume you are trying to see if a year matches ONE of the years in your … | |
Re: I think you need to find a simpler tutorial as there is no need to keep querying your database on every page, just do it once at login and ensure all required data is stored in your session variables as required and then use checks on the session data to … | |
Re: Guessing at the id's that link your tables and not knowing the WHERE cluase: "SELECT tbl_project.project_name, tbl_delivarables.deliverables, tbl_employee.employee_name FROM tbl_project INNER JOIN tbl_deliverables ON tbl_deliverables.project_id=tbl_project.project_id INNER JOIN tbl_employees ON tbl_employees.employee_id=tbl_deliverables.employee_id WHERE ........" | |
Re: Use a join on the same table, something like: SELECT tbl1.*, tbl2.* FROM table_name AS tbl1 INNER JOIN table_name AS tbl2 ON tbl1.a=tble2.b Not tested and a quick example ![]() | |
Re: Set a style in you style sheet and apply that. In style sheet: .date-celebrants { font-color: yellow; } And in you HTML/PHP put: echo '<span class="date-celebrants">' .date('M'). ' ' .('Celebrants'). '</span>'; | |
Rather than write a huge list of properties used by a class I want to know if I can dynamically generate them when needed. I have looked and __set and __get but I am not sure how (or if) I use them with what I am trying to do. The … | |
Re: This is the code I use and run a cron job: backup_tables('user','password','database'); /* backup the db OR just a table */ function backup_tables($user,$pass,$db) { $suffix = date("mdY-Hi"); #Execute the command to create backup sql file exec("mysqldump --user={$user} --password={$pass} --quick --add-drop-table --add-locks --extended-insert --lock-tables --all {$db} > ../db_backups/backup.sql"); #Now zip that … | |
Re: Generally, undefined variable means that it has no value and it is just a warning, change to this: <?php if (isset($confirmation)) { echo $confirmation; } ?> This should get rid of the warning but doesn't help as to why the variable is empty. Then for your if statement shpould work … | |
I am not new to OOP I am tidying up a very large site of mine and trying to create a much better structure (more in keeping with the whole point of OOP). I have decided to use mysqli (please don't suggest PDO as I have decided againast it) which … | |
Re: Use CSS to set a background colour to rows with errors: tr.error { backround-color: red; } Then check if there is an error and if so, apply the style to your table row (replaces line 22 in your posted code): echo'<tr'; if ($part[2] == 'error') { echo ' class="error"'; } … | |
Re: Formatting on here is no different to any other forum, just type in the box and when you want to display code, hit the Code link, put in the code and click the Insert Code button. As for your problem, try this: SELECT count(*) from Inquiry Inner Join Inquirer on … | |
Re: Your button should be a submit instead as what you have won't submit your form or post your data. `<input type="submit" id="nw_update" value="NW_Update"/>` | |
Re: I am wondering if your name="type" is causing a conflict as type is used as part of a form elements details. Have you tried changing it to something else and see what happens? Also, are you sure that one of the radio buttons is being selected? | |
Re: Because you can only access protected properties and methods from the same class or a child class. If you want to access them from outside the class you need to make them public. | |
Re: A couple of things: 1. Your are using the variable `$password` but I can't see anywhere above that code that actuallys assigns a value to that variable. 2. You are assigning your query to a variable but not actually running the query anywhere, you don't need a blank space for … | |
Re: rotten69 didn't change your code for the OR, you cannot use OR in PHP, only in sql queries. So it should be if($row['banned'] == 1 || $row['banned'] == 2) { header ('location: url'); } You don't need speach marks around numbers/integers as suggested earlier either. Have you echo'd `$row['banned']` to … | |
Re: Try changing your where variable to: $where="where cas_no='".$c_no."' "; | |
Re: Are you definitely using MD5 in the database (i.e. not SHA1)? Also I would recommend trimming your posted data to ensure there is no white space. | |
Re: Firslty, name each radio button the same and then give each one a different value: <input type="radio" name="radio_name" value="radio_value1" /> <input type="radio" name="radio_name" value="radio_value2" /> // And so on Then for the PHP you just need to get the value based on the name: $radio_value = $_POST['radio_name']; Obviously change the … | |
Re: You will always get those results as you are basing the selection on the name and the name A in the payment table has a value of 3 no matter what records in the order table. So rather than trying to get those results with a query, why not set … | |
Re: Your button has no value so it will be empty. 2 things: 1. Change your buttons to a submit and remove the javascript: <input type="submit" class="btn" name="submit_yes" value="Yes" /> <input type="submit" class="btn btn-primary active" name="submit_no" value="No" /> Then change your PHP to get the value of the submit: <?php $refresh … | |
Re: You can't use $_REQUEST, $_POST or $_GET in classes, you need to send that information from the page that is getting that information by instantiating the class in that page. Can you post the code where you are using the class and methods. | |
I have the following script: $('#login-box .forgot-pwd').click(function (e) { e.preventDefault(); $('#login-box #main-login').hide("fast"); $('#login-box .login-error').hide(); $('#login-box #forgot-login').show("fast"); $('#forgot-username').focus(); $('#login-box .forgot-send').click(function (e) { e.preventDefault(); $.ajax({ url: '/login.php', data: $('#login-box form.get-password').serialize() + '&action=forgot', type: 'POST', success: function(html) { if (html == 'success') { $('#login-box #forgot-login').hide("fast"); $('#login-box').append('<p>Your password has been emailed to you</p>'); $('#mask … | |
Re: It really depends how far you want to go with checking for duplicatiomn but if you want to make sure they aren't swapping firstname and last name, you could use this SELECT COUNT(*) FROM users WHERE ((FirstName = UPPER('$textFirstname') AND LastName = UPPER('$textLastname')) OR (FirstName = UPPER('$textLastname') AND LastName = … | |
![]() | Re: Tray adding `or die(mysql_error())` to the end of your query to see if that helps with finding out what is going wrong: $result = mysql_query("SELECT * FROM table WHERE h_ip ='$r_ip'") or die(mysql_error()); ![]() |
Re: Not sure if this would be causing your problem but `<?php echo $PHP_SELF;?>` should be `<?php echo $_SERVER['PHP_SELF'];?>` | |
Re: Where are you getting the `$profile_records` array information from for the code at the top of the page? I only see it in your code from line 19. Also the code from line 19 has the variable `$profile_record` and not `$profile_records`. | |
Re: You don't say exactly what your problem is but for one thing you are using mysql_fetch_array twice on your first query (lines 34 and 42) which I am certain will be causing you problems. | |
Re: $imagid cannot be set as you are not echoing it. Change to: <a href='deleteimage.php?imgid=<?php echo $row['image_id']; ?>'>Delete</a> | |
Re: Go into your post, hover over te image and click the edit icon. In the edit image pop-up, click advanced and change the link url to what you want it to be. | |
Can anyone help with this please (I have read a lot and cannot see an issue with what I am doing and it is driving me mad). My css for the @font-face is: @font-face { font-family: 'NotethisRegular'; src: url("fonts/Note_this-webfont.eot"); src: url("fonts/Note_this-webfont.ttf") format('truetype'), url("fonts/Note_this-webfont.svg#NotethisRegular") format('svg'); font-weight: normal; font-style: normal; } The … | |
Re: I am presuming your are allocating a value to your $item variable somewhere above this code. But you have two problems, the first being that if you are going to use the While loop you need to use == not just =: while ($item == current($_POST)) Secondly, you cannot just … | |
Re: Firslty - you should keep your styling separate rather than putting it inline so move all styling into a style sheet. Then all you need to make a gap between your divs is to use padding or margins: // In your stylesheet add a class (name what is relevant to … | |
Re: I am not sure what the : is for but to do what you want, it should be: WHERE message LIKE '."'%$substring%'".'; | |
Re: phorce is correct but they should be the other way around: <?php endwhile; endif; ?> You are also missing your semi-colon after calling the template_directory | |
Re: I am not entirely sure what the problem is from your description unless you are referring to the funny A<< and A>> in your button text which is because you haven't used html entities. In your code, replace << with « and >> with » | |
![]() | Re: That is because your class btn has been assigned to a (link) in your css and a submit button isn't a link. Just remove the a from a.btn in your stylesheet and that should work. ![]() |
Re: You have no php tags around your code and you are not using speach marks where needed, try this <div class="wrapper pad_bot3"> <?php echo '<figure class="left marg_right1"><img src="'.$row['photourl'].'" alt=""></figure>'; echo '<p class="pad_bot1"><strong class="color2">'.$row['parish'].'</strong></p>'; echo '<p class="pad_bot1"><strong class="color2">'.$row['bedroom'].','.$row['bathroom'].'<br>'; echo ' Price: <span class="color1">'.$row['status'].'</span></strong></p>'; ?> <a href="#" class="button">Read more</a> </div> | |
Re: To add more than one variable to a url string you need to use & index.php?page=view_user.php&ref1= | |
Re: Where are you calling your function createNavigationMenu in the first instance and what paremters are you sending through as $isSubMenu will only be set to false if you are not passing through a setting for the function parameter as this may be where your problem is coming from? | |
Re: Not sure, but try something like (basically you need to use remove as well) this: $('#dialog').dialog({ modal: true, hide: "explode", show: "blind", close: function(event, ui) { $(this).dialog('destroy').remove(); } }); | |
Re: This is telling you that the variable in your query is empty. Try echoing out the query to make sure it is as expected and then run what is echo'd out directly in phpMyAdmin to see if you get any errors there as well. $query="select amount_id from payment where admission_no='$admission_no'"; … | |
Re: The holder won't increase when the content of a floated div inside it increases in content as floating a div takes it out of the containing div. What you need to do is create a class to clear the floats and place this after your floated elements inside the holder … | |
Re: Or you can just put your `$_POST['band']` variable into your query without assigning it to another variable. Either way I would also suggest putting the variable in speech marks to prevent problems: $result = mysql_query("SELECT * FROM gigs WHERE band LIKE '%'".$band."'%'"); You can also tidy up your if statement … ![]() | |
Re: I would add them to an array and either store that array in a session or pass it as a variable from page to page. | |
Re: This is wrong if (!(isset($pagenum))) Should be if (!isset($pagenum)) You are missing the OFFSET in your query, your query should be in this format: mysql_query("SELECT table_columns FROM table_name WHERE conditional ORDER BY column_name ASC_or_DESC LIMIT num_rows_per_page OFFSET curr_page_number_*_num_rows_per_page"); | |
Re: A few things 1. Why are you using an onclick function to submit your form when there is no need as you are not doing anything complex, just submitting it? 2. If you are using onclick instead of submit you need to completely remove the action= from your form tag … |
The End.