473,834 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert Select image from MySQL PHP -- what am I doing wrong

63 New Member
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong

casting_registr ation.php

Expand|Select|Wrap|Line Numbers
  1. <table>
  2. <tr>
  3. <td>
  4.   <form enctype="multipart/form-data" action="thankyou.php" method="post" name="registrationform">
  5.       Choose a shows:
  6.  </td>
  7. <td>   <select name="shows"> 
  8.       <option selected value="no show selected">Select a show</option>
  9.       <option value="Bad Girls">Bad Girls</option>
  10.       <option value="Real World">Real World</option>
  11.       <option value="Road Rules">Road Rules</option>
  12.       <option value="Murder">Murder</option>
  13.       <option value="Steveo">Steveo</option>
  14.       <option value="The Simple Life">The Simple Life</option>
  15.     </select>
  16. </td>
  17. <td>
  18.     Gender:
  19. </td>
  20. <td>
  21.     <select name="gender">
  22.       <option selected value="no gender selected">Select your gender</option>
  23.       <option value="Female">Female</option>
  24.       <option value="Male">Male</option>
  25.     </select>   
  26. </td>
  27. <td>    
  28.     Age:
  29. </td>
  30. <td colspan="7">    
  31.     <select name="age">
  32.       <option selected value="no age selected">What is your age</option>
  33.       <option value="18">18</option>
  34.       <option value="19">19</option>
  35.       <option value="20">20</option>
  36.       <option value="21">21</option>
  37.       <option value="22">22</option>
  38.       <option value="23">23</option>
  39.       <option value="24">24</option>
  40.       <option value="25">25</option>
  41.       <option value="26">26</option>
  42.       <option value="27">27</option>
  43.       <option value="28">28</option>
  44.     </select>
  45. </td>
  46. </tr>
  47. <tr>
  48. <td>
  49.     First Name: 
  50. </td>
  51. <td>
  52.     <input type="text" name="first_name" />
  53. </td>
  54. <td>    
  55.     Last Name: 
  56. </td>
  57. <td>
  58.     <input type="text" name="last_name" />
  59. </td>
  60. <td>    
  61.     Email Address: 
  62. </td>
  63. <td>
  64.     <input type="text" name="email_address" />
  65. </td>
  66. </tr>
  67. <tr>
  68. <td>
  69.     Phone: 
  70. </td>
  71. <td>
  72.     <input type="text" name="phone_number" />
  73. </td>
  74. <td>
  75.     City: 
  76. </td>
  77. <td>
  78.     <input type="text" name="city" />
  79. </td>
  80. <td>
  81.     State: 
  82. </td>
  83. <td>
  84.     <input type="text" name="state" />
  85. </td>
  86. <td>
  87.     Zip: 
  88. </td>
  89. <td>
  90.     <input type="text" name="zip" />
  91. </td>
  92. </tr>
  93. <tr>
  94. <td colspan="7"> 
  95. Please choose an image to upload: <input type="file" name="imgdata" id="imgdata"><br>
  96. <input type="hidden" name="MAX_FILE_SIZE" value="2000000">
  97.     <input type="submit" name="upload" id="upload" value="Add Record" />
  98.  
  99.   </form>
  100.   </td>
  101.   </tr>
  102.  </table>
  103.  
  104.  
Which takes you to thankyou.php

Expand|Select|Wrap|Line Numbers
  1.  
  2. if(isset($_POST['upload']) && $_FILES['imgdata']['size'] > 0)
  3. {
  4. $fileName = $_FILES['imgdata']['name'];
  5. $tmpName  = $_FILES['imgdata']['tmp_name'];
  6. $fileSize = $_FILES['imgdata']['size'];
  7. $fileType = $_FILES['imgdata']['type'];
  8.  
  9. $fp      = fopen($tmpName, 'r');
  10. $content = fread($fp, filesize($tmpName));
  11. $content = addslashes($content);
  12. fclose($fp);
  13. $encoded = chunk_split(base64_encode($content));
  14. $decoded = chunk_split(base64_decode($content));
  15.  
  16.     if(!get_magic_quotes_gpc())
  17.     {
  18.         $fileName = addslashes($fileName);
  19.     }
  20. }
  21.  
  22.             function my_insert_to_mysql_function($encoded)
  23.             {
  24.                 $con = mysql_connect("localhost","kronus","gohomE2k");
  25.                 if (!$con)
  26.                 {
  27.                     die('Could not connect: ' . mysql_error());
  28.                 }
  29.                 else
  30.                 {
  31.                     mysql_select_db("kronus", $con);
  32.                     $my_sql_string = "INSERT INTO casting_registration 
  33.                     (SHOWS, GENDER, AGE, FIRST_NAME, LAST_NAME, EMAIL_ADDRESS, PHONE_NUMBER, CITY, STATE, ZIP, PICTURE) 
  34.                     VALUES
  35.                     ('$_REQUEST[shows]', '$_REQUEST[gender]', '$_REQUEST[age]', '$_REQUEST[first_name]', '$_REQUEST[last_name]', '$_REQUEST[email_address]', '$_REQUEST[phone_number]', '$_REQUEST[city]', '$_REQUEST[state]', '$_REQUEST[zip]', '$encoded')";
  36.  
  37.                     if (!mysql_query($my_sql_string,$con))
  38.                       {
  39.                         // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  40.                           die('Error: ' . mysql_error());
  41.                         // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  42.                       }
  43.                     // echo 'Errors reported' .     mysql_error();
  44.                     // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  45.                 }
  46.                 mysql_close($con);
  47.             }
  48. </script>
  49. <script language="php">
  50.  
  51.             function my_select_to_mysql_function($encoded)
  52.             {
  53.                 $con = mysql_connect("localhost","kronus","gohomE2k");
  54.                 if (!$con)
  55.                 {
  56.                     die('Could not connect: ' . mysql_error());
  57.                 }
  58.                 mysql_select_db("kronus", $con);
  59.                 $my_sql_string = "SELECT * FROM casting_registration 
  60.                 WHERE SHOWS='" . $_REQUEST[shows] . "' AND GENDER= '" . $_REQUEST[gender] . "' AND AGE= '" . $_REQUEST[age] . "' AND FIRST_NAME= '" . $_REQUEST[first_name] . "' AND LAST_NAME= '" . $_REQUEST[last_name] . "' AND EMAIL_ADDRESS= '" . $_REQUEST[email_address] . "' AND CITY= '" . $_REQUEST[city] . "' AND  STATE= '" . $_REQUEST[state] . "' AND  ZIP= '" . $_REQUEST[zip] . "' AND  PICTURE= '" . $encoded . "'
  61.                 LIMIT 0 , 30";
  62.                 if (!mysql_query($my_sql_string,$con))
  63.                   {
  64.                         die('Error: ' . mysql_error());
  65.                         // echo 'Errors reported' .     mysql_error();
  66.                   }
  67.                 else
  68.                   {
  69.                         // echo 'Your SQL query is: ' .$my_sql_string;
  70.                         echo "<form action='registered.php' method='post'>";
  71.                         $someVar = mysql_query($my_sql_string,$con);
  72.                         $i = '1';
  73.                         while($row = mysql_fetch_array($someVar))
  74.                         {
  75.                         echo "<input type='textfield' name='shows" .$i. "' value='" .$row['SHOWS'] . "'><input type='textfield' name='gender" .$i. "' value='" .$row['GENDER'] . "'><input type='textfield' name='age" .$i. "' value='" .$row['AGE'] . "'><input type='textfield' name='first_name" .$i. "' value='" . $row['FIRST_NAME']. "'><input type='textfield' name='last_name" .$i. "' value='" . $row['LAST_NAME']. "'><br /><input type='textfield' name='email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "'><input type='textfield' name='phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "'><input type='textfield' name='city" .$i. "' value='" . $row['CITY']. "'><input type='textfield' name='state" .$i. "' value='" . $row['STATE']. "'><input type='textfield' name='zip" .$i. "' value='" . $row['ZIP']. "'><br /><img src='gateway.php?picture='" .$encoded . "'><br />";
  76.  
  77.                         echo "<input type='hidden' name='hidden_registered_id" .$i. "' value='" .$row['REGISTERED_ID'] . "'><input type='hidden' name='hidden_shows" .$i. "' value='" .$row['SHOWS'] . "' id='hidden_shows" .$i. "' value='" .$row['SHOWS'] . "'><input type='hidden' name='hidden_gender" .$i. "' value='" .$row['GENDER'] . "' id='hidden_gender" .$i. "' value='" .$row['GENDER'] . "'><input type='hidden' name='hidden_age" .$i. "' value='" .$row['AGE'] . "' id='hidden_age" .$i. "' value='" .$row['AGE'] . "'><input type='hidden' name='hidden_first_name" .$i. "' value='" . $row['FIRST_NAME']. "' id='hidden_first_name" .$i. "' value='" . $row['FIRST_NAME']. "'><input type='hidden' name='hidden_last_name" .$i. "' value='" . $row['LAST_NAME']. "' id='hidden_last_name" .$i. "' value='" . $row['LAST_NAME']. "'><input type='hidden' name='hidden_email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "' id='hidden_email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "'><input type='hidden' name='hidden_phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "' id='hidden_phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "'><input type='hidden' name='hidden_city" .$i. "' value='" . $row['CITY']. "' id='hidden_city" .$i. "' value='" . $row['CITY']. "'><input type='hidden' name='hidden_state" .$i. "' value='" . $row['STATE']. "' id='hidden_state" .$i. "' value='" . $row['STATE']. "'><input type='hidden' name='hidden_zip" .$i. "' value='" . $row['ZIP']. "' id='hidden_phone_zip" .$i. "' value='" . $row['ZIP']. "'><p>";
  78.                         $i++;
  79.                         }
  80.                         echo "<input type='hidden' name='my_i' value='" .$i. "'><input type='submit' name='update_button' value='Update Record'>";
  81.                         echo "</form>";                      
  82.                   }
  83.                 // echo 'Errors reported' .     mysql_error();
  84.                 mysql_close($con);
  85.             }
  86.  
  87.  
  88.           function welcome_writing_function()
  89.             {
  90.                 echo 'Thank you, ';
  91.                 echo $_REQUEST['first_name'];
  92.                 echo '&nbsp;';
  93.                 echo $_REQUEST['last_name'];
  94.                 echo ', for registering to the casting department of ';
  95.                 echo '&nbsp;';
  96.                 echo $_REQUEST['shows'];
  97.                 echo '&nbsp;';
  98.             }
  99.  
  100.           function comments_writing_function()
  101.             {
  102.                 echo $_REQUEST['picture'];
  103.                 echo '<p />';
  104.                 echo 'We will contact you at: ';
  105.                 echo $_REQUEST['email_address'];
  106.                 echo '<br />';
  107.                 echo $_REQUEST['phone_number'];
  108.                 echo '<br />';
  109.             }
  110.  
  111.           function first_half_writing_function()
  112.             {
  113.                 echo $_REQUEST['gender'];
  114.                 echo '&nbsp;';
  115.                 echo $_REQUEST['age'];
  116.                 echo '&nbsp;';
  117.                 echo $_REQUEST['first_name'];
  118.                 echo '&nbsp;';
  119.                 echo $_REQUEST['last_name'];
  120.                 echo '<br />';
  121.                 echo $_REQUEST['email_address'];
  122.                 echo '<br />';
  123.                 echo $_REQUEST['phone_number'];
  124.                 echo '<br />';
  125.                 echo $_REQUEST['city'];
  126.                 echo '<br />';
  127.                 echo $_REQUEST['state'];
  128.                 echo '<br />';
  129.                 echo $_REQUEST['zip'];
  130.                 echo '<br />';
  131.                 echo $_REQUEST['picture'];
  132.                 echo '&nbsp;';
  133.             }
  134.  
  135.           function second_half_writing_function()
  136.             {
  137.                 $words1 = ' on ';
  138.                 $words2 = date('m-d-y');
  139.                 $words3 = date('G') - 3;
  140.                 $words4 = date(':i:s');
  141.                 $time_right_now = $words1. ' ' .$words2. ' ' .$words3.$words4. ' PST';
  142.                 echo $time_right_now;
  143.             }
  144.  
  145.     </script>
  146. <div style="position:absolute; display:inline; top:500px; left:70px;">
  147.   <script language="php">
  148.         welcome_writing_function();
  149.         my_insert_to_mysql_function($encoded);
  150.         my_select_to_mysql_function($encoded);
  151.     </script>
  152. </div>
  153.  
  154.  
And here is the gateway.php which is supposed to be able to allow you to view the image via the thankyou.php

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.                 $con = mysql_connect("localhost","username","password");
  4.                 if (!$con)
  5.                 {
  6.                     die('Could not connect: ' . mysql_error());
  7.                 }
  8.                 mysql_select_db("username", $con);
  9.  
  10.                 $my_sql_string = "select picture from casting_registration where registered_id ='" . $_REQUEST['registered_id'] . "'";
  11.                 if (!mysql_query($my_sql_string,$con))
  12.                   {
  13.                         die('Error: ' . mysql_error());
  14.                   }
  15.                 else
  16.                   {
  17.                         // echo 'Your SQL query is: ' .$my_sql_string;
  18.                         $someVar = mysql_query($my_sql_string,$con);
  19.                         $i = '1';
  20.                         while($row = mysql_fetch_array($someVar))
  21.                         {
  22.                             $encodeddata = $row[picture];
  23.                         }
  24.                   }
  25.                 // echo 'Errors reported' .     mysql_error();
  26.                 mysql_close($con);
  27.                 header("Content-type: image/jpeg");
  28.                 echo base64_decode($encodeddata);
  29. ?>
  30.  
  31.  
The textfields are populated just fine on the select, but it returns a question mark icon and looking in the db itself, I can see by the sizes that it actually uploaded the file, but when I export the the table to Microsoft .xls file, it has a bunch of jiberish binary code instead of an image.

Why can't I get this? Please, someone help! I've been trying for a week now and I do not understand what else I can do.
May 29 '07 #1
2 2583
Tarik Monem
63 New Member
OK, I believe that the issue is with either how I'm inputting the data into the db (which I believe is the true problem -- due to jiberish being in the xls output file via phpadmin) or my gateway.php script that is the issue, because I was able to remove the question mark icon by correcting some syntax in my thankyou.php

Expand|Select|Wrap|Line Numbers
  1.  
  2. <img src='gateway.php?registered_id=".$row['REGISTERED_ID']."'>
  3.  
  4.  
After doing a view source on the web page, which successfully returns the correct info

Expand|Select|Wrap|Line Numbers
  1.  
  2. gateway.php?registered_id=63
  3.  
  4.  
May 29 '07 #2
Tarik Monem
63 New Member
OK, I figured it out

I'm entering only the name of the file into the db and copying the image to an images directory

Expand|Select|Wrap|Line Numbers
  1. <script language="php">
  2.  
  3. if(isset($_POST['upload']) && $_FILES['imgdata']['size'] > 0)
  4. {
  5. $fileName = $_FILES['imgdata']['name'];
  6. $tmpName  = $_FILES['imgdata']['tmp_name'];
  7. $fileSize = $_FILES['imgdata']['size'];
  8. $fileType = $_FILES['imgdata']['type'];
  9.  
  10. $fp      = fopen($tmpName, 'r');
  11. $content = fread($fp, filesize($tmpName));
  12. $content = addslashes($content);
  13. $dbfilename = "" .rand().$_REQUEST['first_name'].$_REQUEST['last_name'].$_FILES["imgdata"]["name"];
  14. move_uploaded_file($_FILES["imgdata"]["tmp_name"],
  15. "images/" .$dbfilename);
  16.  
  17. fclose($fp);
  18. }
  19.  
  20.             function my_insert_to_mysql_function($dbfilename)
  21.             {
  22.                 $con = mysql_connect("localhost","username","password");
  23.                 if (!$con)
  24.                 {
  25.                     die('Could not connect: ' . mysql_error());
  26.                 }
  27.                 else
  28.                 {
  29.                     mysql_select_db("dbname", $con);
  30.                     $my_sql_string = "INSERT INTO casting_registration 
  31.                     (SHOWS, GENDER, AGE, FIRST_NAME, LAST_NAME, EMAIL_ADDRESS, PHONE_NUMBER, CITY, STATE, ZIP, PICTURE) 
  32.                     VALUES
  33.                     ('$_REQUEST[shows]', '$_REQUEST[gender]', '$_REQUEST[age]', '$_REQUEST[first_name]', '$_REQUEST[last_name]', '$_REQUEST[email_address]', '$_REQUEST[phone_number]', '$_REQUEST[city]', '$_REQUEST[state]', '$_REQUEST[zip]', '".$dbfilename."')";
  34.  
  35.                     if (!mysql_query($my_sql_string,$con))
  36.                       {
  37.                         // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  38.                           die('Error: ' . mysql_error());
  39.                         // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  40.                       }
  41.                     // echo 'Errors reported' .     mysql_error();
  42.                     // echo '<br /> Your SQL query is: ' .$my_sql_string;                
  43.                 }
  44.                 $id= mysql_insert_id();
  45.                 echo '<input type=hidden name=id value="' . $id . '">';
  46.                 mysql_close($con);
  47.             }
  48. </script>
  49. <script language="php">
  50.  
  51.             function my_select_to_mysql_function($dbfilename)
  52.             {
  53.                 $con = mysql_connect("localhost","username","password");
  54.                 if (!$con)
  55.                 {
  56.                     die('Could not connect: ' . mysql_error());
  57.                 }
  58.                 mysql_select_db("dbname", $con);
  59.                 $my_sql_string = "SELECT * FROM casting_registration 
  60.                 WHERE SHOWS='" . $_REQUEST[shows] . "' AND GENDER= '" . $_REQUEST[gender] . "' AND AGE= '" . $_REQUEST[age] . "' AND FIRST_NAME= '" . $_REQUEST[first_name] . "' AND LAST_NAME= '" . $_REQUEST[last_name] . "' AND EMAIL_ADDRESS= '" . $_REQUEST[email_address] . "' AND CITY= '" . $_REQUEST[city] . "' AND  STATE= '" . $_REQUEST[state] . "' AND  ZIP= '" . $_REQUEST[zip] . "'
  61.                 LIMIT 0 , 30";
  62.                 if (!mysql_query($my_sql_string,$con))
  63.                   {
  64.                         die('Error: ' . mysql_error());
  65.                         // echo 'Errors reported' .     mysql_error();
  66.                   }
  67.                 else
  68.                   {
  69.                         // echo 'Your SQL query is: ' .$my_sql_string;
  70.                         echo "<form action='registered.php' method='post'>";
  71.                         $someVar = mysql_query($my_sql_string,$con);
  72.                         $i = '1';
  73.                         while($row = mysql_fetch_array($someVar))
  74.                         {
  75.                         echo "<input type='textfield' name='shows" .$i. "' value='" .$row['SHOWS'] . "'><input type='textfield' name='gender" .$i. "' value='" .$row['GENDER'] . "'><input type='textfield' name='age" .$i. "' value='" .$row['AGE'] . "'><input type='textfield' name='first_name" .$i. "' value='" . $row['FIRST_NAME']. "'><input type='textfield' name='last_name" .$i. "' value='" . $row['LAST_NAME']. "'><br /><input type='textfield' name='email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "'><input type='textfield' name='phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "'><input type='textfield' name='city" .$i. "' value='" . $row['CITY']. "'><input type='textfield' name='state" .$i. "' value='" . $row['STATE']. "'><input type='textfield' name='zip" .$i. "' value='" . $row['ZIP']. "'><br /><img src='images/" .$dbfilename."' height='200px'><br />";
  76.  
  77.                         echo "<input type='hidden' name='hidden_registered_id" .$i. "' value='" .$row['REGISTERED_ID'] . "'><input type='hidden' name='hidden_shows" .$i. "' value='" .$row['SHOWS'] . "' id='hidden_shows" .$i. "' value='" .$row['SHOWS'] . "'><input type='hidden' name='hidden_gender" .$i. "' value='" .$row['GENDER'] . "' id='hidden_gender" .$i. "' value='" .$row['GENDER'] . "'><input type='hidden' name='hidden_age" .$i. "' value='" .$row['AGE'] . "' id='hidden_age" .$i. "' value='" .$row['AGE'] . "'><input type='hidden' name='hidden_first_name" .$i. "' value='" . $row['FIRST_NAME']. "' id='hidden_first_name" .$i. "' value='" . $row['FIRST_NAME']. "'><input type='hidden' name='hidden_last_name" .$i. "' value='" . $row['LAST_NAME']. "' id='hidden_last_name" .$i. "' value='" . $row['LAST_NAME']. "'><input type='hidden' name='hidden_email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "' id='hidden_email_address" .$i. "' value='" . $row['EMAIL_ADDRESS']. "'><input type='hidden' name='hidden_phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "' id='hidden_phone_number" .$i. "' value='" . $row['PHONE_NUMBER']. "'><input type='hidden' name='hidden_city" .$i. "' value='" . $row['CITY']. "' id='hidden_city" .$i. "' value='" . $row['CITY']. "'><input type='hidden' name='hidden_state" .$i. "' value='" . $row['STATE']. "' id='hidden_state" .$i. "' value='" . $row['STATE']. "'><input type='hidden' name='hidden_zip" .$i. "' value='" . $row['ZIP']. "' id='hidden_phone_zip" .$i. "' value='" . $row['ZIP']. "'><p>";
  78.                         $i++;
  79.                         }
  80.                         echo "<input type='hidden' name='my_i' value='" .$i. "'><input type='submit' name='update_button' value='Update Record'>";
  81.                         echo "</form>";                      
  82.                   }
  83.                 // echo 'Errors reported' .     mysql_error();
  84.                 mysql_close($con);
  85.             }
  86. </script>
  87.   <script language="php">
  88.         welcome_writing_function();
  89.         my_insert_to_mysql_function($dbfilename);
  90.         my_select_to_mysql_function($dbfilename);
  91.     </script>
  92.  
  93.  
Hope this helps someone out :-)
May 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
2240
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a product in the database with that ID (primary key), just UPDATE the price, and if there is no product with that ID it should do an INSERT for that item. Now I've tried it in several ways and I can't seem to get it to execute
11
4860
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address and have thus included a column in my address table called num_of_contacts. Everytime I add a new contact, I would like to increment the num_of_contacts column in the address table. Is this possible?
3
2347
by: Christopher Mouton | last post by:
We regularly make drive images of our entire server and store it at a backup site. To be honest I have never fully understood how the imaging programs deal with open files. My question is will the drive image make a good copy of MySQL DB or should I be running a mysqldump before doing the drive image?
8
7005
by: Johannes A. Brunner | last post by:
Got a simple problem. I code some site and because Im a freak I made my own session-handling. When a user open up my site it will check if there is a ssid in the url if not generate one. this will be done by a function generate_ssid() and works fine. next step is to register the ssid in the table session this will be done by the following code: ************************************************************************* function...
10
52877
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable string or NULL. Becaus i have a if statement: if .... cursor.execute(".................insert NULL ..............") if ....
6
2367
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output parameters. It returns my error text message in another output parameter as "ok", which is the value that is set in the stored procedure prior to doing the insert. It returns my var for @@rowcount as 1. However, the record does not get into the table. ...
2
16667
by: Marc Solé | last post by:
Hello, I want to insert an image to a specific column of a dataGridWiew. I explain what I'm doing: - I define the ColumnType as a DataGridViewImageColumn. - I select the image (an icon of open folder). When I accept, in the design form, appears in the ImageColumn the typical red cross of an image not found.
14
2910
by: Ben | last post by:
I don't know whether anyone can help, but I have an odd problem. I have a PSP (Spyce) script that makes many calls to populate a database. They all work without any problem except for one statement. I first connect to the database... self.con = MySQLdb.connect(user=username, passwd =password) self.cursor = self.con.cursor() self.cursor.execute("SET max_error_count=0")
3
2686
by: eholz1 | last post by:
Hello PHP programmers. I had a brilliant idea on one of my pages that selects some data from my mysql database. I first set the page up to display some info and an image, just one item, with a row of data, etc. then I thought it would be nice to do a select, and perhaps an update (the title of the image) on the same page.
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9643
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10789
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10504
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10544
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7755
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3079
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.