Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8361839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:47:40+00:00 2026-06-09T11:47:40+00:00

This is some example code from my app: int page_id; string page_name; enum COLUMNS

  • 0

This is some example code from my app:

int page_id;
string page_name;

enum COLUMNS {
    PAGE_ID,
    PAGE_NAME
};

if (mysql_query(conn, "SELECT page_id, page_name FROM pages")) {
    exit_mysql_error(conn);
}

MYSQL_RES *res = mysql_use_result(conn);

while (MYSQL_ROW row = mysql_fetch_row(res)) {
    page_id = *(int *)res[PAGE_ID];
    page_name = res[PAGE_NAME];
    // do some stuff where I need the page_id and page_name int/string
}

So imho this isn’t the right way to obtain the integer value from the result (yet it works) but I couldn’t find good example on how to do it. Also I’m quite new to programming in C++, so any feedback on the code sample is welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:47:42+00:00Added an answer on June 9, 2026 at 11:47 am
    page_id = atoi(row[0]);
    page_name = row[1]; // not really sure
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I took some code from this Microsoft provided Example which allows me to
The other day, I came across this construct: static_cast<size_type>(-1) in some example C++ code,
Example: We found this is some vendor written code and we're trying to figure
I'm new to this kabeja package so please can some one provide code example
This is my code: package com.example.testcode; import android.app.ListFragment; import android.app.LoaderManager; import android.content.CursorLoader; import android.content.Loader;
Found this is some example CSS I was reading and I'm having a hard
This is what i want to achive with some web technology: example http://img171.imageshack.us/img171/2585/decacb00845442de800a5c5.png I
I have a file containing some data (for example, 00927E2B112DB958......). This data is a
I have one file (for example: test.txt), this file contains some lines and for
I've used this example to to implement some sort of guestbook, only I'm using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.