Jump to content

Search the Community

Showing results for tags 'em'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 11 results

  1. Il Domandatore

    Why use em?

    On w3schools.com it's suggested use em instead of px because first it's relative and second it's static. I'm still confused; which is the improvement?
  2. In the help topic for text-indent http://www.w3schools.com/cssref/pr_text_text-indent.asp I think you should add a note that text-indent is commonly used with "em" since that creates indentations that are relative to the chosen font size instead of being a fixed number of pixels. The "Play It" button for the "length" option should have a radio button for "1 em" and "2 em". http://www.w3schools.com/cssref/playit.asp?filename=playcss_text-indent I didn't know anything about "em" and had never seen it until someone else saw the difficulties I was having with trying to set fixed pixel sizes. Having that more on this tutorial page would have helped me.
  3. After fetching my data from the database, all of them were fetched correctly, but i want to parse all of them to the next page after storing them in an array for easy access on the next page ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <?php $array = array( $index_id, $weekly_gen_news, $what_is_env, $things_in_env, $need_to_clean, $how_does_env, $african_env, $env_culture, $env_and_event, $cnn_env, $weekly_gen_news ); header("location: echo.php?GetArray=$array"); exit();?> ///////////////////////////////////////////////////////////////////////////////////////////////////////////// and when i parse them, i only see this on the url---->......./ echo.php?GetArray=Array i tried to get them using $_GET['GetArray'] but its not working Also how can i display the variables individualy
  4. My php Designer 7 and Dreamweaver cs5 no longer recognizes class files and function files and this happened after uninstalled and reinstalled my server PLEASE what should i do. Am on windows
  5. The thing just stop working and i can't log into my database through my browsers by clicking the http://localhost/phpmyadmin/,Infact i can no longer execute my php files on my browsers as well because it will just output unable to connect
  6. line23:Duplicate entry '1' for key 1 This is the line of code that has the error----> $sql=mysql_query("INSERT INTO forum_answer(question_id, a_id, a_name, a_email, a_answer, a_datetime) VALUES('$id','$max_id','$a_name','$a_email','$a_answer','$datetime')") or die('line'.__LINE__.':'.mysql_error());
  7. Am designing a simple php forum platform with mysql database. But on redirecting from a page called main_forum.php to a page called view_topic.php, am stuck with this error message------> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='4'' at line 1 What should i do, please am dieing ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////main_forum.php//// <?phpinclude("connect_to_mysql.php");$forum_output='';$sql=mysql_query("SELECT * FROM forum_question ORDER BY id DESC LIMIT 6") or die(mysql_error()); while($row=mysql_fetch_array($sql)){ $id=$row['id']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $datetime=$row['datetime']; $forum_output.=' <table width="1300" border="0" cellspacing="2" cellpadding="6" align="center" ><tr> <th width="49" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">ID</li></ul></th> <th width="362" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Your Topic</li></ul></th> <th width="120" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Views</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Reply</li></ul></th> <th width="83" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Email</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Date</li></ul></th> </tr><br /><br />'; $forum_output.=' <tr> <td bgcolor="#CCCCCC">'.$id.'</td> <td bgcolor="#CCCCCC"><a href="view_topic.php?id='.$id.'"><font size="large">'.$topic.'</font></a></td> <td bgcolor="#CCCCCC" align="center">Viewed by '.$view.' persons</td> <td bgcolor="#CCCCCC" align="center"><b>'.$reply.'</b></td> <td bgcolor="#CCCCCC">'.$email.'</td> <td bgcolor="#CCCCCC">'.$datetime.'</td> </tr> <tr> <td align="center" colspan="2" bgcolor="#CCCCCC">Create New Topic</td> </tr> </table><br /><br />'; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><link href="style.css" rel="stylesheet" type="text/css" media="screen" /></head><body><div id="mainwrapper"> <div id="container"> <?php echo $forum_output; ?> <!---<table width="1300" border="0" cellspacing="1" cellpadding="6" align="center" > <!--- <tr> <th width="49" bgcolor="#004200" scope="col" style><h2 style="color: #FFF">ID</h2></th> <th width="362" bgcolor="#004200" scope="col"><h2 style="color: #FFF">TOPIC</h2></th> <th width="302" bgcolor="#004200" scope="col"><h2 style="color: #FFF">VIEWS</h2></th> <th width="264" bgcolor="#004200" scope="col"><h2 style="color: #FFF">REPLY</h2></th> <th width="83" bgcolor="#004200" scope="col"><h2 style="color: #FFF">EMAIL</h2></th> <th width="89" bgcolor="#004200" scope="col"><h2 style="color: #FFF">DATE</h2></th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>----> <!-- <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> ---> </div></div></body></html> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////view_topic.php/////// <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');include_once("connect_to_mysql.php");$topic_output='';$id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE id='".$_GET['id']."'";$result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $name=$row['name']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $detail=$row['detail']; $datetime=$row['datetime']; $topic_output=' <table width="900" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <th scope="col"><li style="color:#004200;"><h3>'.$topic.'</h3></li></th> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px">'.$detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>By: '.$name.'</strong> <strong> Email: '.$email.'</strong></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: <font>'.$datetime.'</strong></li></td> </tr> <tr> <td> </td> </tr> </table>'; ?> <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');$answer_output='';$sql2=mysql_query("SELECT * FROM forum_answer WHERE question_id='$id'") or die(mysql_error());$row=mysql_fetch_array($sql2);while($row){ $a_id=$row['a_id']; $a_name=$row['a_name']; $a_email=$row['a_email']; $a_answer=$row['a_answer']; $a_detail=$row['a_detail']; $a_datetime=$row['a_datetime']; $answer_output.=' <table width="600" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <td><li style="color:#004200;"><strong>By: '.$a_name.'</strong></li></td> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px" align="center">'.$a_detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: '.$a_datetime.' <strong> Email: '.$a_email.'</strong></strong></li></td> </tr> </table> '; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"> <?php echo $topic_output; ?></div><br /><br /><div align="center" style="margin:0px 24px 0px 24px" id="answer_output"> <?php echo $answer_output; ?></div><br /> <?php$sql3=mysql_query("SELECT view FROM forum_question WHERE id='$id'") or die(mysql_error()); $row = mysql_fetch_array($sql3); $view=$row['view']; ////if have no counter value set counter ==1 if($view=0){ $view=1; } $sql4=mysql_query("INSERT INTO forum_question(view) VALUE('$view') WHERE id='$id'") or die(mysql_error()); ///Count more values $addview=$view+1; $sql5=mysql_query("UPDATE forum_question SET view='$addview' WHERE id='$id'") or die(mysql_error()); mysql_close(); ?><br /><br /><br /><div align="left" style="margin:0px 0px 0px 24px" id="table"><form action="add_answer.php" method="POST"><table width="595" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="203"><li style="color:#004200;">NAME:</li></td> <td width="386"><label for="a_name"></label> <input type="text" name="a_name" id="a_name" size="60"/></td> </tr> <tr> <td><li style="color:#004200;">EMAIL:</li></td> <td><input type="text" name="a_email" id="a_email" size="60"/></td> </tr> <tr> <td valign="bottom"><li style="color:#004200;">ANSWER:</li></td> <td><label for="a_answer"></label> <textarea name="a_answer" id="a_answer" cols="57" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> <input type="submit" name="submit" id="submit" value="SUBMIT" /> <input type="reset" name="reset" id="submit2" value="RESET" /> </td> </tr></table><input name="id" type="hidden" value="<?php echo $id; ?>"/></form></div></div></body></html>
  8. Am designing a simple php forum platform using mysql, On redirecting from a page called main_forum.php to a page called view_topic.php, i have this error message on the view_topic.php page You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='4'' at line 1 what should i do------- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////main_forum.php///// <?phpinclude("connect_to_mysql.php");$forum_output='';$sql=mysql_query("SELECT * FROM forum_question ORDER BY id DESC LIMIT 6") or die(mysql_error()); while($row=mysql_fetch_array($sql)){ $id=$row['id']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $datetime=$row['datetime']; $forum_output.=' <table width="1300" border="0" cellspacing="2" cellpadding="6" align="center" ><tr> <th width="49" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">ID</li></ul></th> <th width="362" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Your Topic</li></ul></th> <th width="120" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Views</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Reply</li></ul></th> <th width="83" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Email</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Date</li></ul></th> </tr><br /><br />'; $forum_output.=' <tr> <td bgcolor="#CCCCCC">'.$id.'</td> <td bgcolor="#CCCCCC"><a href="view_topic.php?id='.$id.'"><font size="large">'.$topic.'</font></a></td> <td bgcolor="#CCCCCC" align="center">Viewed by '.$view.' persons</td> <td bgcolor="#CCCCCC" align="center"><b>'.$reply.'</b></td> <td bgcolor="#CCCCCC">'.$email.'</td> <td bgcolor="#CCCCCC">'.$datetime.'</td> </tr> <tr> <td align="center" colspan="2" bgcolor="#CCCCCC">Create New Topic</td> </tr> </table><br /><br />'; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><link href="style.css" rel="stylesheet" type="text/css" media="screen" /></head><body><div id="mainwrapper"> <div id="container"> <?php echo $forum_output; ?> <!---<table width="1300" border="0" cellspacing="1" cellpadding="6" align="center" > <!--- <tr> <th width="49" bgcolor="#004200" scope="col" style><h2 style="color: #FFF">ID</h2></th> <th width="362" bgcolor="#004200" scope="col"><h2 style="color: #FFF">TOPIC</h2></th> <th width="302" bgcolor="#004200" scope="col"><h2 style="color: #FFF">VIEWS</h2></th> <th width="264" bgcolor="#004200" scope="col"><h2 style="color: #FFF">REPLY</h2></th> <th width="83" bgcolor="#004200" scope="col"><h2 style="color: #FFF">EMAIL</h2></th> <th width="89" bgcolor="#004200" scope="col"><h2 style="color: #FFF">DATE</h2></th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>----> <!-- <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> ---> </div></div></body></html> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////view_topic.php//// <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');include_once("connect_to_mysql.php");$topic_output='';$id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE id='".$_GET['id']."'";$result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $name=$row['name']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $detail=$row['detail']; $datetime=$row['datetime']; $topic_output=' <table width="900" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <th scope="col"><li style="color:#004200;"><h3>'.$topic.'</h3></li></th> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px">'.$detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>By: '.$name.'</strong> <strong> Email: '.$email.'</strong></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: <font>'.$datetime.'</strong></li></td> </tr> <tr> <td> </td> </tr> </table>'; ?> <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');$answer_output='';$sql2=mysql_query("SELECT * FROM forum_answer WHERE question_id='$id'") or die(mysql_error());$row=mysql_fetch_array($sql2);while($row){ $a_id=$row['a_id']; $a_name=$row['a_name']; $a_email=$row['a_email']; $a_answer=$row['a_answer']; $a_detail=$row['a_detail']; $a_datetime=$row['a_datetime']; $answer_output.=' <table width="600" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <td><li style="color:#004200;"><strong>By: '.$a_name.'</strong></li></td> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px" align="center">'.$a_detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: '.$a_datetime.' <strong> Email: '.$a_email.'</strong></strong></li></td> </tr> </table> '; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"> <?php echo $topic_output; ?></div><br /><br /><div align="center" style="margin:0px 24px 0px 24px" id="answer_output"> <?php echo $answer_output; ?></div><br /> <?php$sql3=mysql_query("SELECT view FROM forum_question WHERE id='$id'") or die(mysql_error()); $row = mysql_fetch_array($sql3); $view=$row['view']; ////if have no counter value set counter ==1 if($view=0){ $view=1; } $sql4=mysql_query("INSERT INTO forum_question(view) VALUE('$view') WHERE id='$id'") or die(mysql_error()); ///Count more values $addview=$view+1; $sql5=mysql_query("UPDATE forum_question SET view='$addview' WHERE id='$id'") or die(mysql_error()); mysql_close(); ?><br /><br /><br /><div align="left" style="margin:0px 0px 0px 24px" id="table"><form action="add_answer.php" method="POST"><table width="595" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="203"><li style="color:#004200;">NAME:</li></td> <td width="386"><label for="a_name"></label> <input type="text" name="a_name" id="a_name" size="60"/></td> </tr> <tr> <td><li style="color:#004200;">EMAIL:</li></td> <td><input type="text" name="a_email" id="a_email" size="60"/></td> </tr> <tr> <td valign="bottom"><li style="color:#004200;">ANSWER:</li></td> <td><label for="a_answer"></label> <textarea name="a_answer" id="a_answer" cols="57" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> <input type="submit" name="submit" id="submit" value="SUBMIT" /> <input type="reset" name="reset" id="submit2" value="RESET" /> </td> </tr></table><input name="id" type="hidden" value="<?php echo $id; ?>"/></form></div></div></body></html>
  9. Am designing a simple php forum platform with mysql database. But on redirecting from a page called main_forum.php to a page called view_topic.php, am stuck with this error message------> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='4'' at line 1 What should i do, please am dieing ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////main_forum.php//// <?phpinclude("connect_to_mysql.php");$forum_output='';$sql=mysql_query("SELECT * FROM forum_question ORDER BY id DESC LIMIT 6") or die(mysql_error()); while($row=mysql_fetch_array($sql)){ $id=$row['id']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $datetime=$row['datetime']; $forum_output.=' <table width="1300" border="0" cellspacing="2" cellpadding="6" align="center" ><tr> <th width="49" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">ID</li></ul></th> <th width="362" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Your Topic</li></ul></th> <th width="120" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Views</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Reply</li></ul></th> <th width="83" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Email</li></ul></th> <th width="100" bgcolor="#004200" scope="col" height="10"><ul><li style="color: #FFF">Date</li></ul></th> </tr><br /><br />'; $forum_output.=' <tr> <td bgcolor="#CCCCCC">'.$id.'</td> <td bgcolor="#CCCCCC"><a href="view_topic.php?id='.$id.'"><font size="large">'.$topic.'</font></a></td> <td bgcolor="#CCCCCC" align="center">Viewed by '.$view.' persons</td> <td bgcolor="#CCCCCC" align="center"><b>'.$reply.'</b></td> <td bgcolor="#CCCCCC">'.$email.'</td> <td bgcolor="#CCCCCC">'.$datetime.'</td> </tr> <tr> <td align="center" colspan="2" bgcolor="#CCCCCC">Create New Topic</td> </tr> </table><br /><br />'; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><link href="style.css" rel="stylesheet" type="text/css" media="screen" /></head><body><div id="mainwrapper"> <div id="container"> <?php echo $forum_output; ?> <!---<table width="1300" border="0" cellspacing="1" cellpadding="6" align="center" > <!--- <tr> <th width="49" bgcolor="#004200" scope="col" style><h2 style="color: #FFF">ID</h2></th> <th width="362" bgcolor="#004200" scope="col"><h2 style="color: #FFF">TOPIC</h2></th> <th width="302" bgcolor="#004200" scope="col"><h2 style="color: #FFF">VIEWS</h2></th> <th width="264" bgcolor="#004200" scope="col"><h2 style="color: #FFF">REPLY</h2></th> <th width="83" bgcolor="#004200" scope="col"><h2 style="color: #FFF">EMAIL</h2></th> <th width="89" bgcolor="#004200" scope="col"><h2 style="color: #FFF">DATE</h2></th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr>----> <!-- <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> ---> </div></div></body></html> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////view_topic.php/////// <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');include_once("connect_to_mysql.php");$topic_output='';$id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE id='".$_GET['id']."'";$result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $name=$row['name']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $detail=$row['detail']; $datetime=$row['datetime']; $topic_output=' <table width="900" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <th scope="col"><li style="color:#004200;"><h3>'.$topic.'</h3></li></th> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px">'.$detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>By: '.$name.'</strong> <strong> Email: '.$email.'</strong></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: <font>'.$datetime.'</strong></li></td> </tr> <tr> <td> </td> </tr> </table>'; ?> <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');$answer_output='';$sql2=mysql_query("SELECT * FROM forum_answer WHERE question_id='$id'") or die(mysql_error());$row=mysql_fetch_array($sql2);while($row){ $a_id=$row['a_id']; $a_name=$row['a_name']; $a_email=$row['a_email']; $a_answer=$row['a_answer']; $a_detail=$row['a_detail']; $a_datetime=$row['a_datetime']; $answer_output.=' <table width="600" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <td><li style="color:#004200;"><strong>By: '.$a_name.'</strong></li></td> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px" align="center">'.$a_detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: '.$a_datetime.' <strong> Email: '.$a_email.'</strong></strong></li></td> </tr> </table> '; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"> <?php echo $topic_output; ?></div><br /><br /><div align="center" style="margin:0px 24px 0px 24px" id="answer_output"> <?php echo $answer_output; ?></div><br /> <?php$sql3=mysql_query("SELECT view FROM forum_question WHERE id='$id'") or die(mysql_error()); $row = mysql_fetch_array($sql3); $view=$row['view']; ////if have no counter value set counter ==1 if($view=0){ $view=1; } $sql4=mysql_query("INSERT INTO forum_question(view) VALUE('$view') WHERE id='$id'") or die(mysql_error()); ///Count more values $addview=$view+1; $sql5=mysql_query("UPDATE forum_question SET view='$addview' WHERE id='$id'") or die(mysql_error()); mysql_close(); ?><br /><br /><br /><div align="left" style="margin:0px 0px 0px 24px" id="table"><form action="add_answer.php" method="POST"><table width="595" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="203"><li style="color:#004200;">NAME:</li></td> <td width="386"><label for="a_name"></label> <input type="text" name="a_name" id="a_name" size="60"/></td> </tr> <tr> <td><li style="color:#004200;">EMAIL:</li></td> <td><input type="text" name="a_email" id="a_email" size="60"/></td> </tr> <tr> <td valign="bottom"><li style="color:#004200;">ANSWER:</li></td> <td><label for="a_answer"></label> <textarea name="a_answer" id="a_answer" cols="57" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> <input type="submit" name="submit" id="submit" value="SUBMIT" /> <input type="reset" name="reset" id="submit2" value="RESET" /> </td> </tr></table><input name="id" type="hidden" value="<?php echo $id; ?>"/></form></div></div></body></html>
  10. Am designing a simple php forum platform in dreamweaver using mysql database,but when i run the script, on redirecting to a page called view_topic.com it shows this error message----> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='4'' at line 1 The $topic_output normally echos out then followed by the above sql error message ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');include_once("connect_to_mysql.php");$topic_output='';$id=$_GET['id'];$sql="SELECT * FROM forum_question WHERE `id`='".$_GET['id']."'";$result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); $name=$row['name']; $topic=$row['topic']; $view=$row['view']; $reply=$row['reply']; $email=$row['email']; $detail=$row['detail']; $datetime=$row['datetime']; $topic_output=' <table width="900" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <th scope="col"><li style="color:#004200;"><h3>'.$topic.'</h3></li></th> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px">'.$detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>By: '.$name.'</strong> <strong> Email: '.$email.'</strong></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: <font>'.$datetime.'</strong></li></td> </tr> <tr> <td> </td> </tr> </table>'; ?> <?php///Error reportingerror_reporting(E_ALL);ini_set('display errors','1');$answer_output='';$sql2=mysql_query("SELECT * FROM forum_answer WHERE question_id='$id'") or die(mysql_error());$row=mysql_fetch_array($sql2);while($row){ $a_id=$row['a_id']; $a_name=$row['a_name']; $a_email=$row['a_email']; $a_answer=$row['a_answer']; $a_detail=$row['a_detail']; $a_datetime=$row['a_datetime']; $answer_output.=' <table width="600" height="127" border="0" cellpadding="2" cellspacing="4" align="center"> <tr> <td><li style="color:#004200;"><strong>By: '.$a_name.'</strong></li></td> </tr> <tr> <td bgcolor="#CCCCCC"><div><p width="500px" align="center">'.$a_detail.'</p></div></td> </tr> <tr> <td bgcolor="#004200"></li></td> </tr> <tr> <td bgcolor="#004200"><li style="color:white;"><strong>Date/Time: '.$a_datetime.' <strong> Email: '.$a_email.'</strong></strong></li></td> </tr> </table> '; }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"><div align="center" style="margin:0px 24px 0px 24px" id="topic_output"> <?php echo $topic_output; ?></div><br /><br /><div align="center" style="margin:0px 24px 0px 24px" id="answer_output"> <?php echo $answer_output; ?></div><br /> <?php$sql3=mysql_query("SELECT view FROM forum_question WHERE id='$id'") or die(mysql_error()); $row = mysql_fetch_array($sql3); $view=$row['view']; ////if have no counter value set counter ==1 if($view=0){ $view=1; } $sql4=mysql_query("INSERT INTO forum_question(view) VALUE('$view') WHERE id='$id'") or die(mysql_error()); ///Count more values $addview=$view+1; $sql5=mysql_query("UPDATE forum_question SET view='$addview' WHERE id='$id'") or die(mysql_error()); mysql_close(); ?><br /><br /><br /><div align="left" style="margin:0px 0px 0px 24px" id="table"><form action="add_answer.php" method="POST"><table width="595" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="203"><li style="color:#004200;">NAME:</li></td> <td width="386"><label for="a_name"></label> <input type="text" name="a_name" id="a_name" size="60"/></td> </tr> <tr> <td><li style="color:#004200;">EMAIL:</li></td> <td><input type="text" name="a_email" id="a_email" size="60"/></td> </tr> <tr> <td valign="bottom"><li style="color:#004200;">ANSWER:</li></td> <td><label for="a_answer"></label> <textarea name="a_answer" id="a_answer" cols="57" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> <input type="submit" name="submit" id="submit" value="SUBMIT" /> <input type="reset" name="reset" id="submit2" value="RESET" /> </td> </tr></table><input name="id" type="hidden" value="<?php echo $id; ?>"/></form></div></div></body></html>
  11. From some of my webpages (in php) I've created html-files for the printer, so leaving the navigation column and some other elements out.It works fine so far, but I want the user give the opportunity to scale the font size from within the document (because dummies can surely not find the browser's menu option). For that reason my font sizes are given in em instead of px, in order to accomodate IE8 and lower. Often you see a number of different sized A-characters in a document as links to larger/smaller font sizes. Unfort. I cannot figure out what's behind those links. Is it CSS or javascript perhaps? Thanks and regards,Egbert Zijlema
×
×
  • Create New...