FirefoxRocks
Feb 15 2007, 10:56 PM
I have successfully setup a MySQL Database with a few tables in it to store user input!   Woohoo! Now the problem is displaying the data. I want 4 boxes echoing across with 3 rows down so that makes 12 boxes (12 of the most recent records). I have no clue how to do this because I cannot use the W3Schools example of echoing into a table. Here is the code I used but it echoes the same information across the entire row of 4 boxes. CODE <?php $con = mysql_connect("localhost","myDatabase name","myDatabase password"); if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("myTable", $con);
$result = mysql_query("SELECT * FROM myField1 ORDER BY myField2 DESC");
echo "<table summary='myTable summary'>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> *Field/database information was edited out to protect privacy. As you can see, it tells the database to echo one full row of the same info, then loop through the whole thing as many times as there are records. First of all, I only want a total of 12 records being echoed. Second of all, I want the 4x3 boxes layout. Could someone please give me some modifications to the code I am using right now? I tried using <div>s also, didn't work. I'm designing this site for a major section for a game site.
Comment/Reply (w/o sign-up)
TavoxPeru
Feb 16 2007, 05:23 AM
QUOTE(FirefoxRocks @ Feb 15 2007, 05:56 PM)  I have successfully setup a MySQL Database with a few tables in it to store user input!   Woohoo! Now the problem is displaying the data. I want 4 boxes echoing across with 3 rows down so that makes 12 boxes (12 of the most recent records). I have no clue how to do this because I cannot use the W3Schools example of echoing into a table. Here is the code I used but it echoes the same information across the entire row of 4 boxes. CODE <?php $con = mysql_connect("localhost","myDatabase name","myDatabase password"); if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("myTable", $con);
$result = mysql_query("SELECT * FROM myField1 ORDER BY myField2 DESC");
echo "<table summary='myTable summary'>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "<td style='width:25%'>XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?> *Field/database information was edited out to protect privacy. As you can see, it tells the database to echo one full row of the same info, then loop through the whole thing as many times as there are records. First of all, I only want a total of 12 records being echoed. Second of all, I want the 4x3 boxes layout. Could someone please give me some modifications to the code I am using right now? I tried using <div>s also, didn't work. I'm designing this site for a major section for a game site. First of all change your select statement to the following: CODE $result = mysql_query("SELECT * FROM myField1 ORDER BY myField2 DESC limit 12"); What this will do is to select only the last 12 or whatever number of records from your table. Now for echoing correctly your data something like this will work: CODE <?php $nRows=mysql_num_rows($result)/4; $i=0; echo "<table summary='myTable summary'>\n"; while($i<$nRows){ echo "<tr>\n"; for ($h = 0; $h < 4; $h++) { echo "<td style='width:25%'>"; if($row = mysql_fetch_array($result)) { echo "XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power']; } else echo " "; echo "</td>"; } echo "</tr>\n"; $i++; } echo "</table>\n"; ?> Best regards,
Comment/Reply (w/o sign-up)
FirefoxRocks
Feb 16 2007, 06:36 PM
Before I use the code into my page, could you please explain the \n part of the code that you put in after the table tags? The code looks really good  And I hope it works. I will try it soon. The only thing I don't understand is the \n parts. ***about 1 hour later*** Great! It works! Now I need even more advanced coding. Read the stuff below: If the $row['type'] is offensive, I want the table cell background to be #f00. If the $row['type'] is defensive, I want the table cell background to be #48d1cc. I tried this: CODE if($row = mysql_fetch_array($result)) { if($row['type'] = off) { $cbkgd="background-color:#f00"; } elseif($row['type'] = def) { $cbkgd="background-color:#48d1cc"; } else { $cbkgd="background-color:#fff"; } } It didn't work, the whole row went to 1 colour and only 1 record/row was displayed. Could someone please help me do this?
Comment/Reply (w/o sign-up)
mastercomputers
Feb 17 2007, 02:33 AM
The "\n" part is just formatting for the source code really. Since you're outputting the content as is, it doesn't take into account newline characters which is what "\n" is. e.g. If you did: CODE <?php echo '<table>'; echo '<tr>'; echo '<td>some content</td>'; echo '</tr>'; echo '</table>'; ?> And viewed the source you'll get: CODE <table><tr><td>some content</td></tr></table> Similar to doing: CODE <?php echo '<table><tr><td>some content</td></tr></table>'; ?> Now if you did: CODE <?php echo "<table>\n\t<tr>\n\t\t<td>some content</td>\n\t</tr>\n</table>"; ?> When you view the source it'd look like: CODE <table> <tr> <td>some content</td> </tr> </table> "\n" is newline characters and "\t" is tab characters. "\n" is not the HTML <br /> element. Also remember that using PHP, special characters like \n and \t must be in double quotes, not single quotes unless you want to output exactly those characters. Just test it out if you like: CODE <?php echo '\n'; // displays \n echo "\n"; // wont display anything but viewing source would have a newline there (just like you pressed enter when typing it) ?> Read up strings and interpolation in the PHP manual for more understanding and finding more special characters that can be used. I haven't gone over your code yet, but by the looks of things you'd be better off using HEREDOC strings, again you'll find more information by looking into the strings in the PHP manual. Cheers, MC
Comment/Reply (w/o sign-up)
mastercomputers
Feb 17 2007, 02:44 AM
QUOTE(FirefoxRocks @ Feb 17 2007, 07:36 AM)  CODE if($row = mysql_fetch_array($result)) { if($row['type'] = off) { $cbkgd="background-color:#f00"; } elseif($row['type'] = def) { $cbkgd="background-color:#48d1cc"; } else { $cbkgd="background-color:#fff"; } } In this code you're using the assignment operator '=', not the comparison operator '=='. You're also using constants instead of the required string, however if the constants don't exist the string is automatically guessed but this is poor programing. I'm not sure, but I think conditions always evaluate to true if it's assigned any value unless you assign an empty/null/0 value. You could use a switch statement like: CODE switch($row['type']) { case 'off': $cdkgd = 'background-color: #f00'; break; case 'def': $cdkgd = 'background-color: #48d1cc'; break; default: $cdkgd = 'background-color: #fff'; break; } Or you could use an if-else statement: CODE if($row['type'] == 'off') { $cdkgd = 'background-color: #f00'; } elseif($row['type'] == 'def') { $cdkgd = 'background-color: #48d1cc'; } else { $cdkgd = 'background-color: #fff'; } I still haven't gotten round to looking at your code yet. Cheers, MC
Comment/Reply (w/o sign-up)
mastercomputers
Feb 17 2007, 03:41 AM
OK, I have looked at your code and here's my suggestion: CODE <?php $row = array( 'user' => 'AbUser', 'victim' => 'Jack the Ripper', 'turns' => 2, 'side' => 'right', 'gold' => 120, 'lost' => 0, 'killed' => 0, 'mxp' => 48, 'points_b' => 1800, 'points_a' => 50, 'type' => 'melee', 'power' => 'average' ); //remove this array //$con = mysql_connect('localhost', 'myDatabaseName', 'myDatabasePassword') or exit('Could not connect: '.mysql_error()); //mysql_select_db('myTable', $con); //$result = mysql_query('SELECT * FROM `myField1` ORDER BY `myField2` DESC LIMIT 12;'); $i = 0; $tmp_table = ''; //while($row = mysql_fetch_array($result)) { if(empty($tmp_table)) { $tmp_table .= '<table summary="myTable summary">'."\n\t".'<tr>'."\n"; } for($k = 0; $k < 15; $k++) { //remove this for loop if($i != 0 && $i % 4 == 0) { $tmp_table .= "\t".'</tr>'."\n\t".'<tr>'."\n"; } $tmp_table .= "\t\t".'<td style="width: 25%; border: thin solid black;">XKingdom Member: '.$row['user']. '<br />Name of victim: '.$row['victim']. '<br />Attack turns: '.$row['turns']. '<br />Side of attack: '.$row['side']. '<br />Gold stolen: '.$row['gold']. '<br />Units lost: '.$row['lost']. '<br />Units killed: '.$row['killed']. '<br />MXP Gained: '.$row['mxp']. '<br />Victim\'s points: '.$row['points_b']. '<br />Your points: '.$row['points_a']. '<br />Type of battle: '.$row['type']. '<br />Battle power: '.$row['power']. '</td>'."\n"; $i++; if($i == 12) { break; } } //mysql_close($con); if(!empty($tmp_table)) { $tmp_table .= "\t".'</tr>'."\n".'</table>'; echo $tmp_table; } ?> Now since I don't have your database or table, I commented those parts out and just wanted to show a working example. I'm using the same content from my array. To use it, just remove the array, all the comments at the beginning of a line and remove the for loop line and hopefully it's get the results you want. I also added a border around the cells, just to show seperation. Here's the source code view of HTML, just thought I would add that: CODE <table summary="myTable summary"> <tr> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> </tr> <tr>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
</tr> <tr> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> <td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td>
<td style="width: 25%; border: thin solid black;">XKingdom Member: AbUser<br />Name of victim: Jack the Ripper<br />Attack turns: 2<br />Side of attack: right<br />Gold stolen: 120<br />Units lost: 0<br />Units killed: 0<br />MXP Gained: 48<br />Victim's points: 1800<br />Your points: 50<br />Type of battle: melee<br />Battle power: average</td> </tr> </table> Cheers, MC
Comment/Reply (w/o sign-up)
TavoxPeru
Feb 18 2007, 02:14 AM
QUOTE(FirefoxRocks @ Feb 16 2007, 01:36 PM)  Before I use the code into my page, could you please explain the \n part of the code that you put in after the table tags? The code looks really good  And I hope it works. I will try it soon. The only thing I don't understand is the \n parts. ***about 1 hour later*** Great! It works! Now I need even more advanced coding. Read the stuff below: If the $row['type'] is offensive, I want the table cell background to be #f00. If the $row['type'] is defensive, I want the table cell background to be #48d1cc. I tried this: CODE if($row = mysql_fetch_array($result)) { if($row['type'] = off) { $cbkgd="background-color:#f00"; } elseif($row['type'] = def) { $cbkgd="background-color:#48d1cc"; } else { $cbkgd="background-color:#fff"; } } It didn't work, the whole row went to 1 colour and only 1 record/row was displayed. Could someone please help me do this? The \n means a newline and is simply use to code formatting. Now to add the background color to the table cell you need to modify my code, because as you see it first echoes the TD tag and then echoes the data, also, check your type data, i assume that it is a string data, so, try this instead: CODE <?php $nRows=mysql_num_rows($result)/4; $i=0; echo "<table summary='myTable summary'>\n"; while($i<$nRows){ echo "<tr>\n"; for ($h = 0; $h < 4; $h++) { $cbkgd="#fff;"; echo "<td style='width:25%;background-color:"; if($row = mysql_fetch_array($result)) { if($row['type'] == 'off') { $cbkgd="#f00;"; } elseif($row['type'] == 'def') { $cbkgd="#48d1cc;"; } echo $cbkgd . "'>"; echo "XKingdom Member:" . $row['user'] . "<br />Name of victim:" . $row['victim'] . "<br />Attack turns:" . $row['turns'] . "<br />Side of attack:" . $row['side'] . "<br />Gold stolen:" . $row['gold'] . "<br />Units lost:" . $row['lost'] . "<br />Units killed:" . $row['killed'] . "<br />MXP Gained:" . $row['mxp'] . "<br />Victim's points:" . $row['points_b'] . "<br />Your points:" . $row['points_a'] . "<br />Type of battle:" . $row['type'] . "<br />Battle power:" . $row['power']; } else echo $cbkgd . "'> "; echo "</td>"; } echo "</tr>\n"; $i++; } echo "</table>\n"; ?> Best regards,
Comment/Reply (w/o sign-up)
Similar Topics
Keywords : retrieving, data, displaying, boxes, make, grid, boxes,
- Reading Xml Data
Within PHP (2)
Letting Users Add Mysql Data With Php
(1) I'm curious as to the best methods of letting users submit data to a MySQL database, displaying
that data, and removing any unwanted tags etc. from it. Currently, there's a handful of PHP
functions that I know of to help with this: mysql_real_escape_string() - perhaps the best known
and most commonly used function, it should be used in pretty much any MySQL query. It escapes
characters that have SQL significance. QUOTE(php.net) ...which prepends backslashes to the
following characters: \x00, \n, \r, \, ', " and \x1a I like to think I made a pretty....
Getting Certain Parts Of A Record
The character data (17) Ok I need help on this puzzling problem. At first I thought that this person stored the dates in the
MySQL database like this: August 27, 2007 That kinda freaked me out a little, because string dates
are hard to manipulate. Then I found out that he stored both th string data and numerical date,
which I found a little bit odd, but it was like this: 2007-08-27 I need to build a PHP program to
manipulate the data, but I need to access the year, month and day respectively by themselves. I
think that isolating the first 4 characters for the year, last 2 characters for da....
Sql Injection Prevention (passing Numerical Data Across Pages).
PHP/mySQL (9) Even if your building something as simple as a basic news page for your website, if your passing
along url variable strings like (mysite/index.php?page=1), you may be vulnerable to SQL injection
attacks. For cases like these (passing numerical data in url strings), I have a handy dandy little
function to thwart these attempts silly: CODE // For checking if value is a number, if not
return 1. function isNum($val) { if (!is_numeric($val)) { $val = 1; } return ($val); } I
have this function, within my functions.php file, which I use as an include in files w....
Proper Way To Grab User Data?
(1) I'm working on a script where there is a custom user profile and I was wondering if there was a
more efficient way to grab data stored in a database than this method: CODE $sql = "SELECT *
FROM users WHERE `access_name` = \"" .$active_user. "\""; $row =
mysql_fetch_array(mysql_query($sql)); //Link the two tables together; grab the most common thing
that is the *SAME* $user_id = $row ; $sql2 = "SELECT * FROM content WHERE `cid` = \"" .$user_id.
"\""; $row2 = mysql_fetch_array(mysql_query($sql2)); Then on the pages, I just do a where ever
something is supp....
Displaying Hebrew Characters In PHP
(3) Hi, the problem I'm having right now is that the hebrew text that are entered in my MySQL
database display as "??? ???? " question marks when I load them up into my php page. Here's
the MySQL Database: QUOTE SQL result Host: localhost Database: kiklop_videos Generation Time:
Dec 14, 2006 at 04:25 PM Generated by: phpMyAdmin 2.9.1.1 / MySQL 5.0.27-community SQL query: SELECT
* FROM `videos` LIMIT 0, 30 ; Rows: 3 id name description url img 2 Go GoGo
http://castup-sw03.bezeqint.net/cunet/gm.a...lipMediaID=2165 img1 4 Long Text הי....
PHP & MySQL: Displaying Content From A Given ID
(6) Okay so I got this sample link (not working): http://www.acosta.com/joo.asp?id=654 Now suppose
I have a PHP file that would use MySql in order to get all values in the row where id 654 is found.
Here's a sample DB: Table: demnyc ______________________________________ | id |
Name | Age | Email | *----------------------------------------------------* | 1
| Albert | 17 | no email |
*----------------------------------------------------* | 2 | YaPow | 888 |
no email | |__________....
Send XML Data To PHP Page
(0) Hi, i'm trying to send my xml file "xmlDoc" to a php page so I can save it. Does anyone have the
code for this?....
Data Passing - Re An Assignment For School - Please Help :)
(8) I'm working on a small assignment due tomorrow and am having some trouble. I have a functioning
form that you input the data on one php page, and then it does a little math and displays the result
on a new page. The assignment is to make this work on ONE page, and to add some error handling.
I'm having trouble with the basics of passing the data that has been input on the form, back to
itself. I am stuck with a few questions but I'll start with one. I have the data passing back
to itself so that when I start the error checking, the fields won't have ....
Need An Alternative To $http_post_data For PHP4
(5) Hi, my client's host site currently hosts just 4.0. I tried using the
file_get_contents("php://input") and $HTTML_post_data php file to save the XML file from Flash but
when loaded, it returns nothing. I need hlep....
Storing Data Into Xml With A Php Form
Need Help! (2) Hi, I just learned how to read an xml file with PHP. The problem now is that I don't know how to
write onto it. I would like to read my news content and be able to add more to it when another story
comes up but I don't know how to write into the xml via PHP. All I know how to do is to edit the
XML file itself manually. Can anyone help me?....
Need Some Help Displaying A Field
(11) I run a web site that is a directory of sites in my City. Since submissions are free, I continually
receive submissions from webmasters that are NOT at all related. It is of course a waste of time
for them ... and a waste of time for me. (Some people just don't take the 30 seconds to read.)
I have decided to add a new field (area code) which will at least help me in quickly identifying the
spammers. I was thinking I might even do the same thing with postal code. I have added a new field
to the database, and it is now on my submit page for the "submitters" to fi....
Reading Data From Sessions
(2) Hello everyone! Before I start let me just say that ive read many threads on here about php and
sessions, several tutorials and the php manual but I still cant find a solution to my problem. My
problem is that when i try to read data from a session it just comes up blank, and an if statement
to see if the variable is null returns true. The code im using is for a login script which checks
the input from a user and compares it with the data in a database to log the user in, this works
fine, also reading the data from the session works perfectly on the page which the sess....
[PHP + MySQL] Encrypting Data
To protect the password of your DB, for example. (13) Hi! This is my 2nd code of PHP + MySQL. This code is VERY simple: it encript the data in the MySQL
DB. Here we go! ------------------------------------------------------------------------ CODE
$password = "abc"; $new_password = md5($password); echo $new_password; ?> The password "abc"
was codfied using md5() This will be: 900150983cd24fb0d6963f7d28e17f72 CODE $normal_pass =
"abc"; $encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($normal_pass) ==
$encripted_pass) echo "Login Sucessful!"; else echo "Incorrect password."; ?> This c....
Possible To Do?
Reading a remote website's data .. (7) What I need to know is how to do the following? I'm completely confused, although I sort of
have a general feel of what I need to do, I just have no clue how to do it. I need to be able to
take some data from one page, displayed on their site as an HTML table, and then output certain
pieces of it to my site. I will disclaim here and now that what I intend to do does not violate
any laws, as I'm not stealing a persons content. I am using this to act as an online counter, to
see how long someone is online. I also have emailed the company to ask if what I'm....
Php/mysql Data Display
(3) Okay .. got a bit of a question here, so I'll do some explaining. I was asked to do a site for
an online roleplaying game, specifically, a "blackbook" site. I accepted and began my quest for
knowledge of PHP. I've gotten quite "far" to the point that I can now take a user inputted
search value and query the database with that value, and then display the values in a table. My
MySQL table setup is as below: CODE |Name|Reports|Type1|Type2|Quote|Confirmed| When queried
it displays the following: CODE Violator Name: # Reports: Offense(s): Quote: ....
Help With Multi Tier Mysql Application Over Net
receiving data connection from client (6) hi.. i want to make a connection from my desktop client into mysql database at web server.
currently i think it can be provided by PHP. 1. i'm thinking like this: CLIENT -> PHP + MYSQL
CLIENT {sent file} -> PHP {receive file, open connection to MYSQL, insert data from file} how it
will be done ??? 2. the security do you know how to secure it ? thanks......
Displaying Data From Mysql?
(2) how can i display data from mysql with php, just that on one page i want to display only the first
10 things and the next page the next 20 ...etc.. how can i do that?....
Php, Sql Lite: Storing Session's Data?
how so store session in SQLITE? (1) normally, in windows, session data is saved in the location as directed by the "session.save_path"
directives. they only show how to store session data in file. is it possible to store it inside the
SQLite? anyone?....
Looking for retrieving, data, displaying, boxes, make, grid, boxes,
|
See Also,
*SIMILAR VIDEOS*
Searching Video's for retrieving, data, displaying, boxes, make, grid, boxes,
|
advertisement
|
|