-
Posts
468 -
Joined
-
Last visited
Never
Everything posted by chiprivers
-
well if I put the while($row = mysql_fetch_array($result)) { // do this } bit inside the function instead of returning the results of the query, it works, so the query must be working. Is there any rule about retuning an array?
-
i created a function that queried database for records and then returned results but it is not working! function returnResult() { // build query $query = "blah blah"; // run query $result = mysql_query($query); // return result return $result; } Then when I try and use the results like this: while($row = mysql_fetch_array($result)) { // do this } it does not work!! is there a rule relating to functions that stops them from returning such information?
-
I have included a display order column in a database table that includes numbers to show which order the records should be displayed in. i.e. the first one to be displayed will have display_order =1, the second record will have display_order = 2 etc etc What I need now though is a script to allow a user to amend the order in which the records are displayed. First, a page where the records will be displayed with a text input box next to them with the value defaulting to the current display_order value. The user will then be able to alter a value and click submit to update values. I can see that this will be easy if the user amends all values to ensure there is only one for each position, but I need the script to auto amend any effected values if only one record is changed. i.e. if the record with value 8 is amended to 4, the records 4 to 7 will need to be incremented by one Does any body know if their is such a script anywhere to work from?
-
Thanks, I knew it was something like that
-
I am sure there is a shorter way of writing the following: $string = $string."blah blah"; can anyone help? I have tried googling but can't fins what I am looking for!
-
Can I use height and min-height in the same element?
-
I am not very good at following other peoples code, but from having a quick look, is the delete button within the form that the checkboxes are in? I might be wrong cos only an amateur myself, but surely when you hit the submit button with the value delete, it is not sending the information from the other form with the checkboxes in?
-
Being new to using CSS for page layout, I am trying to get used to the anomolies across different browsers, so any assistance would be appreciated. I am trying to layout my page template in <DIV>'s and one <DIV> will hold the main page display area. I want this <DIV> to have a minimum height set so that it always fills to the bottom of the screen. However, I am getting stuck having this increase in size when there is more content. When I display the page in IE7, the <DIV> expands in height to allow for any additional content, but when I display the page in Firefox, the content overflows the bottom of the <DIV>. Is there a way I can ensure the layout works across different browsers?
-
Sorry, you will have to ignore my stupidity! I should have checked my code first, my php script was wrong so everything after it was not displaying!
-
I have started rescripting my site using CSS for page layout but it is not working correctly as a .php file! Let me explain myself; I have started building up the script to layout the header and initially I had it saved as a .htm file. It was working fine and all elements were displaying correctly. I then wanted to add in some php so I resaved as a .php file. It now displays differently in as much that it does not show any empty divs. Is this normal behaviour? The empty divs were displayed when it was a .htm file! This is not a real problem as the divs will house content but it will give me a better understanding of the scripts behaviour.
-
I am relatively new to using CSS for layout purposes, but I have read several tutorials and understand the basic concept. I having trouble getting to grips with the dimension of elements. If I want to specify a specific size for an element, for example a <div>, why does it not adopt the size height I have specified? I have a div with the following css code: #frame { /* main page frame */ width: 800px; min-height: 100px; margin-left: auto; margin-right: auto; background-color: #ffffff } I expected the div to display at the minimum height of 100px but it doesn't! When there is no content in the div it only displays at a height equal to one row of text. If I add some content it expands to the height of the content I have added. How do I get an elemenet to display at an exact height whether there is or is not any content within it? Unless I can get my head around this bit of CSS I think I am going to become unstuck trying to use CSS for positioning so any assistance would be appreciated.
-
Have you checked the script on the page it is directed to? If there is a fault in your script it may display a blank page.
-
So you want two drop down selection boxes in a form, the second of which populates dependant on the value selected in the first box. Is this right? If you want to do it with PHP, I think you will want to reload the page on selection in the first box. A script on the page can check if a value has been selected in the first box, if it has then query a database table that contains the values for the second box that relates to the first selection. I think you can probably also do the same without reloading the page using either Java Script of CSS, not sure about those methods though?
-
When you say validate the submitted details, do you mean query the database and ensure there is a correct record?
-
Could you explain exactly what you are trying to accomplish and post the full script here.
-
To make the image submit the form, why dont you use: <input type="image" name="submit" src="images/SignIn.jpg">
-
PHP page title from strings---how do I do it?
chiprivers replied to gotit's topic in PHP Coding Help
You imply that you already have the variables set fir listing style and listing address, how ever you don't say where you get the information from. If they are already set, you can use: <head> <title><?php echo $info[listing_style]." ". $info[listing_address]; ?></title> </head> However, you are going to have to make sure the bit of code that you use to declare these variables are positioned before the head tags. -
Is there always the same number of headliners and are they located in various positions across the page? I would do a query for each headliner and use: SELECT * FROM shows, artists WHERE shows.headliner_1 = artists.artist_ID
-
I am new to the CSS positioning approach to page layout and have always used tables but I would like to try and use CSS in my current project. I think I get the gerneral box concept and how to position them relativeley and absolutely but I can not work out how to centre a div on a page. What I am trying to do is have one <DIV> that dols the whole page, with a set width equal to the page width. I want this div to be centred in the middlef the display are so that if the browser window is larger than the div, there will be equal blank space either side. How do I do this? If I were using a table to do this I would just include align="center" in the <table> tag but this does not seem to work in the <DIV> tag.
-
[RESOLVED] writing form data to a mysql database
chiprivers replied to sws's topic in PHP Coding Help
Should be using: $_POST['handle'] -
[RESOLVED,thanks!] Array to list of variables. How do you do it?
chiprivers replied to ridiculous's topic in PHP Coding Help
have you tried changing $Course_Pic= ' . $row['Course_Pic'] . '; to $Course_Pic = $row['Course_Pic']; -
[RESOLVED] writing form data to a mysql database
chiprivers replied to sws's topic in PHP Coding Help
I think '{$_POST["stripslashes($online['username'])"]}' should be 'stripslashes($_POST['username'])' -
How to use a form selection with php to upload images [RESOLVED]
chiprivers replied to AdRock's topic in PHP Coding Help
Do you mean you want to change the Description input text box to the select group? -
[RESOLVED,thanks!] Array to list of variables. How do you do it?
chiprivers replied to ridiculous's topic in PHP Coding Help
<? php $query = "SELECT blah blah blah"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $Course_Pic = $row['Course_Pic']; $Course_Name = $row['Course_Name']; etc etc } DISCLAIMER: I am relatively new to PHP / MySQL but I think this is right :D ?> -
Not sure about that GD2 thing but to display an image in PHP script you just use your normal HTML! ie <?php echo "<img src='url'>"; ?>