Jump to content

pak4eva

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pak4eva's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello Does anyone know how to use c#.net I'm looking for a basic tutorial as I am a beginner and have an assignment to hand in next week. I want to be able to send an XML file to a web service...... so basically that means create a web client that can send an XML file thats it !
  2. i still get the same error mate, can you do me a favor please and insert that code into the my code so i can see how it work.... Thanks
  3. sorry to be pain mate but im getting an error "unexpected T_STRING on line......... the line its refereing to is $result = mysql_query($query) or die ("error in Query: $query. " .mysql_error());
  4. Thanks a lot mate, but considering my code below where do i need to insert the above? <?php $host ="?"; $user = "?"; $pass = "?"; $db= "?"; // Connects to your Database $connection = mysql_connect("$host", "$user", "$pass") or die("Unable to connect"); mysql_select_db("$db") or die("Unable to select database"); <?php {$query = "Select Imagename1, Imagename2 From Element Where Symbol ='$_GET'"; IF (Imagename1 = "NULL") { echo("No image available"); } } $result = mysql_query($query) or die ("error in Query: $query. " .mysql_error()); if (mysql_num_rows($result)>0) { echo "<table border=0 cellpadding=0 cellspacing=0>"; while($row= mysql_fetch_row($result)) { echo "<tr>"; echo "<td>" . $row[0]. "</td>"; echo "<td>" . ' '. "</td>"; echo "<td>" . $row[1]. "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "No rows found"; } ?>
  5. This is what im currently using... <?php {$query = "Select Imagename1, Imagename2 From Element Where Symbol ='$_GET'"; IF (Imagename1 = "NULL") { echo("No image available"); }
  6. i've tried something similar but unforunately no luck.....
  7. Hi guys Ive managed to connect my sql database using php but the problem im coming across is outputing a message if something equals to null, i.e. i have an attribute in the database called 'Imagename1' so what i want to do is print out a message saying 'no image exist' Imagename1 = 'NULL' ...... output message 'no image exist'. The code im using is below, your help will be very much appreciated.... <?php $host ="?"; $user = "?"; $pass = "?"; $db= "?"; // Connects to your Database $connection = mysql_connect("$host", "$user", "$pass") or die("Unable to connect"); mysql_select_db("$db") or die("Unable to select database"); <?php {$query = "Select Imagename1, Imagename2 From Element Where Symbol ='$_GET'"; IF (Imagename1 = "NULL") { echo("No image available"); } } $result = mysql_query($query) or die ("error in Query: $query. " .mysql_error()); if (mysql_num_rows($result)>0) { echo "<table border=0 cellpadding=0 cellspacing=0>"; while($row= mysql_fetch_row($result)) { echo "<tr>"; echo "<td>" . $row[0]. "</td>"; echo "<td>" . ' '. "</td>"; echo "<td>" . $row[1]. "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "No rows found"; } ?>
  8. Hi guys Ive managed to connect my sql database using php but the problem im coming across is outputing a message if something equals to null, i.e. i have an attribute in the database called 'Imagename1' so what i want to do is print out a message saying 'no image exist' Imagename1 = 'NULL' ...... output message 'no image exist'. The code im using is below, your help will be very much appreciated.... <?php $host ="?"; $user = "?"; $pass = "?"; $db= "?"; // Connects to your Database $connection = mysql_connect("$host", "$user", "$pass") or die("Unable to connect"); mysql_select_db("$db") or die("Unable to select database"); <?php {$query = "Select Imagename1, Imagename2 From Element Where Symbol ='$_GET'"; IF (Imagename1 = "NULL") { echo("No image available"); } } $result = mysql_query($query) or die ("error in Query: $query. " .mysql_error()); if (mysql_num_rows($result)>0) { echo "<table border=0 cellpadding=0 cellspacing=0>"; while($row= mysql_fetch_row($result)) { echo "<tr>"; echo "<td>" . $row[0]. "</td>"; echo "<td>" . ' '. "</td>"; echo "<td>" . $row[1]. "</td>"; echo "</tr>"; } echo "</table>"; } else { echo "No rows found"; } ?>
  9. Hi guys, i just wnated to know how i can use php script for my form that i have created in html, basically the code is below, what i want to do is when a user selects metal then it should display metals from the database, if metalloids selected then again it should retrieve that info from database..... <form name="input" action="type.php" method="get"> <select name=group> <option>Select Type</option> <option>Metals</option> <option>Metalloids</option> <option>Non-Metals</option> </select> <input name="search2" type="submit" value="search"> </form> If possbile can someone post the actual script please. thanks.
  10. Hi guys Im new to this forum. Currently I am studying at uni and am in my final year. As part of my project I need to design a website using php and sql. My project is based on the periodic table (chemistry). I've done both website and sql side of my project but am really struggling with php since i have never done php before. I currently have one simple script that connects to the database and displays the information for one element only (basically its been hard coded), for example if i click on the element H then it will return the information for H from the database. However, my main headach is I need to use the same script for all elements instead of writing individually i.e. elements such as H, He, O etc... should have the same code but depending on what i click on it should return that information only.... I've been told that to do this i may need to use functions but since i have very little php knowledge i dont have a clue where to begin and time is running out for my as i have 3-4 weeks left for the deadline. Can someone please advise me what to do? Your help will be much appreciated.... Thanks in advance...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.