wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
You'll want to use a join within your first query. That way you only have to deal with 1 while loop. Try the following: <?php //Connect to Db include('library/db_connect.php.inc'); $sql = "SELECT m.*, r.realease_name FROM main m, realeases r WHERE m.visible=1 AND r.band_id = m.id ORDER BY m.name"; $result = mysql_query($sql) or die('Error: ' . mysql_error()); //Count number of rows in main table $num_rows = mysql_num_rows($query); //Include header include('header.php.inc'); //Loop to output all rows while ($row = mysql_fetch_array($result)) { echo '<pre>' . print_r($row, true) . '</pre><hr />'; } //Include right col and footer include('footer.php.inc'); ?> The query I have used is untested. So it may not work. It'll probably need changing slightly.
-
display_errors only takes a boolean value, eg 1 and 0 or On and Off or true and false. ini_set('display_errors', 'On') if you still dont get any errors. Then check your servers error logs. All errors should be written to your servers error logs by default.
-
I dunno.. I dont know what row3 is. I don't have the script infront of me. I only use used it because it was already in your code for where to place the input field.
-
Ok now that we got the query. How do you want the islands ordered. Can you post an illustration/example. Basically depending on how you want them ordered you just got to change the ORDERY BY clause in the query to the field you want your results to be ordered by.
-
[SOLVED] Polling php install question
wildteen88 replied to mbdonner's topic in PHP Installation and Configuration
Due to PHP's configuration you're not allowed to use web based file paths within file, fopen etc, You'll want to change your scripts configuration so you use relative paths instead. All those errors are caused by the first error. Fix the first one and you're good to go. -
No Change this //echo "<td><input type=\"text\" name=\"myvalue[]\" value=\"" . $row[3] . " /></td>"; echo "<td><input type=\"text\" name=\"myvalue[]\" value=\"\" /></td>"; to: echo "<td><input type=\"text\" name=\"myvalue[]\" value=\"" . $row[3] . "\" /></td>"; NOTE: Make sure you change value of the action attribute in the form tag on this line: echo "<form action=\"path/to/script/to/process/form/data.php\" method=\"post\">"; To the script that processes the submited form data.
-
No thats database selection. YOu select the table within your SQL Query: $sql = "SELECT id as userid, fullname, userstatus FROM sometable WHERE userstatus = 1"; sometable is the table mysql query to fetch the userid, fullname and userstatus where userstatus equals to 1.
-
[SOLVED] DANGER! newbie: url friendly howto at mod_rewrite
wildteen88 replied to monkeynote's topic in Apache HTTP Server
It is advided you should not use spaces within filenames on the web. You should use an underscore in replacement of spaces. -
You could use one of the gethostby* functions to verify the domain name. However using gethostby* can be be slow.
-
You used forward slashes instead of backslashes on line 22 for escaping quotes. Yes using single quotes as the string delimiter allows to use double quotes (without having to escape them) within strings, however if you use a single quote within the string you'll have to escape it. Also variables wont work within single quotes. You'll have to concatenate the string to use variables within the string.
-
I have a straightforward question about errors in general
wildteen88 replied to cluce's topic in PHP Coding Help
That will work fine, just make sure your host is using PHP5 and has the mysqli extension enabled (note, the i. The standard mysql library does not support mysqli_* functions). mysqli is for PHP5+ only. You can check this using phpino(); Also I hope you haven't got // at the begging of that line when you upload it to you host. As PHP will ignore that line as it'll see it as comment. -
Sorry to be rude but Ever heard of google? http://www.google.co.uk/search?client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&channel=s&hl=en&q=phpfox&meta=&btnG=Google+Search First link.
-
When defining column names that are reserved words wrap them in backticks: `img`, `caption`, `by`
-
EDIT: didn't read your post properly. Hold on... change this: echo "<td>".$row[3]."</td>"; to this: echo '<td><input type="text" name="myvalue[]" value="' . $row[3] . '" /></td>'; That will now change the forth column into a editable column. In order to submit the data you'll need to warp the table in a form and add a submit button at the end. To do this you'll want to add the following line: Echo '<form action="path/to/script/to/process/form/data.php" method="post">'; Before this line echo "<table cellpadding=10 border=1>"; And change this line: echo "</table>"; to: echo ' <tr> <td colspan="3"> </td> <td align="center"><input type="submit" name="submit" value="Apply"></td> </tr> </table>'; In the script that processes the form data you'll want to use $_POST['myvalue'] to get the data from the form. NOTE: $_POST['myvalue'] holds an array of all the form field, so $_POST['myvalue'][0] gets the first field, $_POST['myvalue'][1] gets second, $_POST['myvalue'][9] gets the 10th etc,
-
This: $sql = mysql_query("INSERT INTO links (image, site, link, date, description, publish) VALUES ('$img_thumb', '$site', '$link', '$date', '$description', 'yes')"); if (!mysql_query($sql,$con)) SHould be: $sql = "INSERT INTO links (image, site, link, date, description, publish) VALUES ('$img_thumb', '$site', '$link', '$date', '$description', 'yes')"; if (!mysql_query($sql,$con)) Your where running mysql_query within mysql_query. mysql_query was defined within $sql.
-
By local do you mean on the server (where the website is hosted from) or do your mean from a clients computer (person who visits your site). If its the latter then it is not possible for PHP to fetch files of a client computer.
-
How Can I Pass an Array via HTTP_POST_VARS?
wildteen88 replied to stervyatnik's topic in PHP Coding Help
$HTTP_*_VARS are now depreciated and have been replaced with $_*, eg $HTTP_POST_VARS should be $_POST Use: $_POST['rate' . $i] When trying to get rateX (X being a number). You do the same with state too: $_POST['state' . $i] -
Directly from php.net: Every time the while loop loops mysql_fetch_rows gets a new row from the result returned from the sql query.
-
I have a straightforward question about errors in general
wildteen88 replied to cluce's topic in PHP Coding Help
Regards of whether the error reporting is disabled PHP will call the or die statement if the function returns false. -
PHP requires an third party library in order for php_mysql.dll to function correctly. This external library is called libmysql.dll. Make sure this file is in the root of the PHP folder. Also delete any instance of libmysql.dll form your computer, but keep libmysql.dll in PHP and MySQL's installation directory only.
-
search google for myspace templates then as I suggested you'll get loads of results.
-
Open propertySQL.inc.php and copy 'n' paste the function getallisland from that file. There is a query in that function which you should be able to edit to change the order.
-
[SOLVED] DANGER! newbie: url friendly howto at mod_rewrite
wildteen88 replied to monkeynote's topic in Apache HTTP Server
You'll have to edit your urls so they conform to your rewrite rules. Apache wont rewrite your hyperlinks for you. The urls you setup within .htaccess are only aliases. -
I'm assuming you are using windows You should be able to do: <a href="\\computer_name\folder-alias\">Folder name</a> Note: folder-alias is the share name you setup when you enabled the Share this folder on the network option in the Sharing tab for the folder you want to access over the network.
-
you can apply multiple margins in one margin statement, margins can be set in either of the following formats: margin: [top] [bottom] margin: 10px auto 10px auto; margin: [top&bottom] [left&right] margin: 10px auto; margin: [all] margin: auto;